3 #define TAG(cell) ((CELL)(cell) & TAG_MASK)
4 #define RETAG(cell,tag) ((CELL)(cell) | (tag))
5 #define UNTAG(cell) ((CELL)(cell) & ~TAG_MASK)
13 #define GC_COLLECTED 5 /* See gc.c */
15 /*** Header types ***/
17 /* Canonical F object */
21 /* Canonical T object */
25 /* Empty stack marker */
30 #define VECTOR_TYPE 10
31 #define STRING_TYPE 11
33 #define HANDLE_TYPE 13
34 #define BIGNUM_TYPE 14
36 bool typep(CELL type, CELL tagged);
37 CELL type_of(CELL tagged);
38 void type_check(CELL type, CELL tagged);
40 INLINE void check_non_empty(CELL cell)
43 general_error(ERROR_UNDERFLOW,F);
46 INLINE CELL tag_boolean(CELL untagged)
48 return (untagged == false ? F : T);
51 INLINE bool untag_boolean(CELL tagged)
53 check_non_empty(tagged);
54 return (tagged == F ? false : true);
57 INLINE CELL tag_header(CELL cell)
59 return RETAG(cell << TAG_BITS,HEADER_TYPE);
62 INLINE CELL untag_header(CELL cell)
64 if(TAG(cell) != HEADER_TYPE)
65 critical_error("header type check",cell);
66 return cell >> TAG_BITS;
69 INLINE CELL tag_object(void* cell)
71 return RETAG(cell,OBJECT_TYPE);
74 INLINE CELL object_type(CELL tagged)
76 return untag_header(get(UNTAG(tagged)));
79 CELL allot_object(CELL type, CELL length);
80 CELL untagged_object_size(CELL pointer);
81 CELL object_size(CELL pointer);