1 #define IMAGE_MAGIC 0x0f0e0d0c
2 #define IMAGE_VERSION 4
7 /* all pointers in the image file are relocated from
8 relocation_base to here when the image is loaded */
9 CELL data_relocation_base
;
12 /* code relocation base */
13 CELL code_relocation_base
;
14 /* size of code heap */
16 /* tagged pointer to t singleton */
18 /* tagged pointer to bignum 0 */
20 /* tagged pointer to bignum 1 */
22 /* tagged pointer to bignum -1 */
24 /* Initial user environment */
25 CELL userenv
[USER_ENV
];
29 const F_CHAR
*image_path
;
30 const F_CHAR
*executable_path
;
31 CELL ds_size
, rs_size
;
32 CELL gen_count
, young_size
, aging_size
, tenured_size
;
40 void load_image(F_PARAMETERS
*p
);
41 void init_objects(F_HEADER
*h
);
42 bool save_image(const F_CHAR
*file
);
44 void primitive_save_image(void);
45 void primitive_save_image_and_exit(void);
47 /* relocation base of currently loaded image's data heap */
48 CELL data_relocation_base
;
50 INLINE
void data_fixup(CELL
*cell
)
52 if(immediate_p(*cell
))
55 F_ZONE
*tenured
= &data_heap
->generations
[TENURED
];
56 *cell
+= (tenured
->start
- data_relocation_base
);
59 CELL code_relocation_base
;
61 INLINE
void code_fixup(CELL cell
)
63 CELL value
= get(cell
);
64 put(cell
,value
+ (code_heap
.segment
->start
- code_relocation_base
));