Back to index

plt-scheme  4.2.1
gc2_obj.h
Go to the documentation of this file.
00001 #include "../src/schpriv.h"
00002 
00003 #if defined(MZ_PRECISE_GC) && !defined(USE_COMPACT_3M_GC)
00004 
00005 #ifdef _WIN32
00006 # define LOG_APAGE_SIZE 16
00007 #else
00008 # define LOG_APAGE_SIZE 14
00009 #endif
00010 typedef struct objhead {
00011 # ifdef MZ_USE_PLACES
00012   unsigned long owner;
00013 #endif
00014   unsigned long hash      : ((8 * sizeof(unsigned long)) - (4+3+LOG_APAGE_SIZE) );
00015   /* the type and size of the object */
00016   unsigned long type      : 3;
00017   /* these are the various mark bits we use */
00018   unsigned long mark      : 1;
00019   unsigned long btc_mark  : 1;
00020   /* these are used for compaction et al*/
00021   unsigned long moved     : 1;
00022   unsigned long dead      : 1;
00023   unsigned long size      : LOG_APAGE_SIZE;
00024 } objhead;
00025 
00026 #define OBJHEAD_SIZE (sizeof(objhead))
00027 #define OBJPTR_TO_OBJHEAD(p) ((objhead *) (((char *)(p)) - OBJHEAD_SIZE))
00028 #define OBJHEAD_TO_OBJPTR(p) ((void *) (((char *)(p)) + OBJHEAD_SIZE))
00029 
00030 
00031 XFORM_NONGCING extern int GC_is_allocated(void *p);
00032 
00033 #define OBJHEAD_HAS_HASH_BITS
00034 #define OBJHEAD_HASH_BITS(p) (OBJPTR_TO_OBJHEAD(p)->hash)
00035 
00036 #endif