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
37 bool typep(CELL type, CELL tagged);
38 CELL type_of(CELL tagged);
39 void type_check(CELL type, CELL tagged);
41 INLINE void check_non_empty(CELL cell)
44 general_error(ERROR_UNDERFLOW,F);
47 INLINE CELL tag_boolean(CELL untagged)
49 return (untagged == false ? F : T);
52 INLINE bool untag_boolean(CELL tagged)
54 check_non_empty(tagged);
55 return (tagged == F ? false : true);
58 INLINE CELL tag_header(CELL cell)
60 return RETAG(cell << TAG_BITS,HEADER_TYPE);
63 INLINE CELL untag_header(CELL cell)
65 if(TAG(cell) != HEADER_TYPE)
66 critical_error("header type check",cell);
67 return cell >> TAG_BITS;
70 INLINE CELL tag_object(void* cell)
72 return RETAG(cell,OBJECT_TYPE);
75 INLINE CELL object_type(CELL tagged)
77 return untag_header(get(UNTAG(tagged)));
80 CELL allot_object(CELL type, CELL length);
81 CELL untagged_object_size(CELL pointer);
82 CELL object_size(CELL pointer);