4
/* GC declarations shared by beam/erl_gc.c and hipe/hipe_gc.c */
10
#define IS_MOVED(x) (!is_header((x)))
12
#define MOVE_CONS(PTR,CAR,HTOP,ORIG) \
16
HTOP[0] = CAR; /* copy car */ \
17
HTOP[1] = PTR[1]; /* copy cdr */ \
18
gval = make_list(HTOP); /* new location */ \
19
*ORIG = gval; /* redirect original reference */ \
20
PTR[0] = THE_NON_VALUE; /* store forwarding indicator */ \
21
PTR[1] = gval; /* store forwarding address */ \
22
HTOP += 2; /* update tospace htop */ \
25
#define MOVE_BOXED(PTR,HDR,HTOP,ORIG) \
30
ASSERT(is_header(HDR)); \
31
gval = make_boxed(HTOP); \
35
nelts = header_arity(HDR); \
36
switch ((HDR) & _HEADER_SUBTAG_MASK) { \
37
case SUB_BINARY_SUBTAG: nelts++; break; \
38
case FUN_SUBTAG: nelts+=((ErlFunThing*)(PTR-1))->num_free+1; break; \
44
#define in_area(ptr,start,nbytes) \
45
((unsigned long)((char*)(ptr) - (char*)(start)) < (nbytes))
48
int within(Eterm *ptr, Process *p);
51
#endif /* __ERL_GC_H__ */