C:/Users/Dennis/src/lang/russell.orig/src/gc/gc_headers.h

Go to the documentation of this file.
00001 /* 
00002  * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
00003  * Copyright (c) 1991, 1992 by Xerox Corporation.  All rights reserved.
00004  *
00005  * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
00006  * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
00007  *
00008  * Permission is hereby granted to copy this garbage collector for any purpose,
00009  * provided the above notices are retained on all copies.
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 /* Is the result a forwarding address to someplace closer to the        */
00029 /* beginning of the block or NIL?                                       */
00030 # define IS_FORWARDING_ADDR_OR_NIL(hhdr) ((unsigned long) (hhdr) <= MAX_JUMP)
00031 
00032 /* Get an HBLKSIZE aligned address closer to the beginning of the block */
00033 /* h.  Assumes hhdr == HDR(h) and IS_FORWARDING_ADDR(hhdr).             */
00034 # define FORWARDED_ADDR(h, hhdr) ((struct hblk *)(h) - (unsigned long)(hhdr))
00035 # endif /*  GC_HEADERS_H */

Generated on Fri Jan 25 10:39:45 2008 for russell by  doxygen 1.5.4