comparison src/alloc.c @ 28469:f66f2b4d5eb7

* alloc.c (MARK_STRING, UNMARK_STRING, STRING_MARKED_P): Expand non-union-type versions of XMARK and friends here, because XMARK and friends won't work on an integer field if NO_UNION_TYPE is not defined. (make_number): Define as a function if it's not defined as a macro.
author Ken Raeburn <raeburn@raeburn.org>
date Sun, 02 Apr 2000 01:52:58 +0000
parents ecba29fa0198
children fc8d42f77d4f
comparison
equal deleted inserted replaced
28468:7237fe6b37af 28469:f66f2b4d5eb7
95 static __malloc_size_t bytes_used_when_full; 95 static __malloc_size_t bytes_used_when_full;
96 96
97 /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer 97 /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer
98 to a struct Lisp_String. */ 98 to a struct Lisp_String. */
99 99
100 #define MARK_STRING(S) XMARK ((S)->size) 100 #define MARK_STRING(S) ((S)->size |= MARKBIT)
101 #define UNMARK_STRING(S) XUNMARK ((S)->size) 101 #define UNMARK_STRING(S) ((S)->size &= ~MARKBIT)
102 #define STRING_MARKED_P(S) XMARKBIT ((S)->size) 102 #define STRING_MARKED_P(S) ((S)->size & MARKBIT)
103 103
104 /* Value is the number of bytes/chars of S, a pointer to a struct 104 /* Value is the number of bytes/chars of S, a pointer to a struct
105 Lisp_String. This must be used instead of STRING_BYTES (S) or 105 Lisp_String. This must be used instead of STRING_BYTES (S) or
106 S->size during GC, because S->size contains the mark bit for 106 S->size during GC, because S->size contains the mark bit for
107 strings. */ 107 strings. */
796 XUNMARK ((i)->up.obj); \ 796 XUNMARK ((i)->up.obj); \
797 (i) = balance_intervals (i); \ 797 (i) = balance_intervals (i); \
798 } \ 798 } \
799 } while (0) 799 } while (0)
800 800
801 801
802 /* Number support. If NO_UNION_TYPE isn't in effect, we
803 can't create number objects in macros. */
804 #ifndef make_number
805 Lisp_Object
806 make_number (n)
807 int n;
808 {
809 Lisp_Object obj;
810 obj.s.val = n;
811 obj.s.type = Lisp_Int;
812 return obj;
813 }
814 #endif
802 815
803 /*********************************************************************** 816 /***********************************************************************
804 String Allocation 817 String Allocation
805 ***********************************************************************/ 818 ***********************************************************************/
806 819