PageRenderTime 17ms CodeModel.GetById 8ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/vm/fixup.hpp

http://github.com/abeaumont/factor
C++ Header | 46 lines | 37 code | 9 blank | 0 comment | 0 complexity | a137d976c6712b1cd89c4dc26c97abe0 MD5 | raw file
 1namespace factor
 2{
 3
 4template<typename T>
 5struct identity {
 6	T operator()(T t)
 7	{
 8		return t;
 9	}
10};
11
12struct no_fixup {
13	static const bool translated_code_block_map = false;
14
15	object *fixup_data(object *obj)
16	{
17		return obj;
18	}
19
20	code_block *fixup_code(code_block *compiled)
21	{
22		return compiled;
23	}
24
25	object *translate_data(const object *obj)
26	{
27		return fixup_data((object *)obj);
28	}
29
30	code_block *translate_code(const code_block *compiled)
31	{
32		return fixup_code((code_block *)compiled);
33	}
34
35	cell size(object *obj)
36	{
37		return obj->size();
38	}
39
40	cell size(code_block *compiled)
41	{
42		return compiled->size();
43	}
44};
45
46}