00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 # ifndef GC_HEADERS_H
00012 # define GC_HEADERS_H
00013 typedef struct hblkhdr hdr;
00014
00015 # define LOG_TOP_SZ 11
00016 # define LOG_BOTTOM_SZ (WORDSZ - LOG_TOP_SZ - LOG_HBLKSIZE)
00017 # define TOP_SZ (1 << LOG_TOP_SZ)
00018 # define BOTTOM_SZ (1 << LOG_BOTTOM_SZ)
00019
00020 # define MAX_JUMP (HBLKSIZE - 1)
00021
00022 extern hdr ** GC_top_index [];
00023
00024 # define HDR(p) (GC_top_index \
00025 [(unsigned long)(p) >> (LOG_BOTTOM_SZ + LOG_HBLKSIZE)] \
00026 [((unsigned long)(p) >> LOG_HBLKSIZE) & (BOTTOM_SZ - 1)])
00027
00028
00029
00030 # define IS_FORWARDING_ADDR_OR_NIL(hhdr) ((unsigned long) (hhdr) <= MAX_JUMP)
00031
00032
00033
00034 # define FORWARDED_ADDR(h, hhdr) ((struct hblk *)(h) - (unsigned long)(hhdr))
00035 # endif