]> gitweb.factorcode.org Git - factor.git/blob - native/memory.h
working on native image output
[factor.git] / native / memory.h
1 typedef struct {
2         CELL base;
3         CELL here;
4         CELL alarm;
5         CELL limit;
6 } ZONE;
7
8 ZONE* z1;
9 ZONE* z2;
10 ZONE* active; /* either z1 or z2 */
11 ZONE* prior; /* if active==z1, z2; if active==z2, z1 */
12
13 void init_arena(CELL size);
14 void flip_zones();
15
16 CELL allot(CELL a);
17
18 INLINE CELL align8(CELL a)
19 {
20         return ((a & 7) == 0) ? a : ((a + 8) & ~7);
21 }
22
23 INLINE CELL get(CELL where)
24 {
25         return *((CELL*)where);
26 }
27
28 INLINE void put(CELL where, CELL what)
29 {
30         *((CELL*)where) = what;
31 }
32
33 INLINE CHAR cget(CELL where)
34 {
35         return *((CHAR*)where);
36 }
37
38 INLINE void cput(CELL where, CHAR what)
39 {
40         *((CHAR*)where) = what;
41 }
42
43 INLINE BYTE bget(CELL where)
44 {
45         return *((BYTE*)where);
46 }
47
48 INLINE void bput(CELL where, BYTE what)
49 {
50         *((BYTE*)where) = what;
51 }
52
53 bool in_zone(ZONE* z, CELL pointer);
54
55 void primitive_room(void);