3 #define TAG(cell) ((CELL)(cell) & TAG_MASK)
4 #define RETAG(cell,tag) ((CELL)(cell) | (tag))
5 #define UNTAG(cell) ((CELL)(cell) & ~TAG_MASK)
14 #define GC_COLLECTED 6 /* See gc.c */
16 /*** Header types ***/
18 /* Canonical F object */
22 /* Canonical T object */
26 /* Empty stack marker */
31 #define VECTOR_TYPE 10
32 #define STRING_TYPE 11
34 #define HANDLE_TYPE 13
35 #define BIGNUM_TYPE 14
38 bool typep(CELL type, CELL tagged);
39 CELL type_of(CELL tagged);
40 void type_check(CELL type, CELL tagged);
42 INLINE void check_non_empty(CELL cell)
45 general_error(ERROR_UNDERFLOW,F);
48 INLINE CELL tag_boolean(CELL untagged)
50 return (untagged == false ? F : T);
53 INLINE bool untag_boolean(CELL tagged)
55 check_non_empty(tagged);
56 return (tagged == F ? false : true);
59 INLINE CELL tag_header(CELL cell)
61 return RETAG(cell << TAG_BITS,HEADER_TYPE);
64 INLINE CELL untag_header(CELL cell)
66 if(TAG(cell) != HEADER_TYPE)
67 critical_error("header type check",cell);
68 return cell >> TAG_BITS;
71 INLINE CELL tag_object(void* cell)
73 return RETAG(cell,OBJECT_TYPE);
76 INLINE CELL object_type(CELL tagged)
78 return untag_header(get(UNTAG(tagged)));
81 void* allot_object(CELL type, CELL length);
82 CELL untagged_object_size(CELL pointer);
83 CELL object_size(CELL pointer);