Mercurial > emacs
comparison src/alloc.c @ 51985:b52e88c3d6d0
(MARK_STRING, UNMARK_STRING, STRING_MARKED_P)
(GC_STRING_CHARS, string_bytes): Use ARRAY_MARK_FLAG rather than
MARKBIT as the gcmarkbit for strings.
| author | Stefan Monnier <monnier@iro.umontreal.ca> |
|---|---|
| date | Mon, 21 Jul 2003 20:03:18 +0000 |
| parents | 111cc76606c6 |
| children | 25f780eb3fd8 |
comparison
equal
deleted
inserted
replaced
| 51984:e9d8b19c6bb1 | 51985:b52e88c3d6d0 |
|---|---|
| 90 static __malloc_size_t bytes_used_when_full; | 90 static __malloc_size_t bytes_used_when_full; |
| 91 | 91 |
| 92 /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer | 92 /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer |
| 93 to a struct Lisp_String. */ | 93 to a struct Lisp_String. */ |
| 94 | 94 |
| 95 #define MARK_STRING(S) ((S)->size |= MARKBIT) | 95 #define MARK_STRING(S) ((S)->size |= ARRAY_MARK_FLAG) |
| 96 #define UNMARK_STRING(S) ((S)->size &= ~MARKBIT) | 96 #define UNMARK_STRING(S) ((S)->size &= ~ARRAY_MARK_FLAG) |
| 97 #define STRING_MARKED_P(S) ((S)->size & MARKBIT) | 97 #define STRING_MARKED_P(S) ((S)->size & ARRAY_MARK_FLAG) |
| 98 | 98 |
| 99 #define VECTOR_MARK(V) ((V)->size |= ARRAY_MARK_FLAG) | 99 #define VECTOR_MARK(V) ((V)->size |= ARRAY_MARK_FLAG) |
| 100 #define VECTOR_UNMARK(V) ((V)->size &= ~ARRAY_MARK_FLAG) | 100 #define VECTOR_UNMARK(V) ((V)->size &= ~ARRAY_MARK_FLAG) |
| 101 #define VECTOR_MARKED_P(V) ((V)->size & ARRAY_MARK_FLAG) | 101 #define VECTOR_MARKED_P(V) ((V)->size & ARRAY_MARK_FLAG) |
| 102 | 102 |
| 104 Lisp_String. This must be used instead of STRING_BYTES (S) or | 104 Lisp_String. This must be used instead of STRING_BYTES (S) or |
| 105 S->size during GC, because S->size contains the mark bit for | 105 S->size during GC, because S->size contains the mark bit for |
| 106 strings. */ | 106 strings. */ |
| 107 | 107 |
| 108 #define GC_STRING_BYTES(S) (STRING_BYTES (S)) | 108 #define GC_STRING_BYTES(S) (STRING_BYTES (S)) |
| 109 #define GC_STRING_CHARS(S) ((S)->size & ~MARKBIT) | 109 #define GC_STRING_CHARS(S) ((S)->size & ~ARRAY_MARK_FLAG) |
| 110 | 110 |
| 111 /* Number of bytes of consing done since the last gc. */ | 111 /* Number of bytes of consing done since the last gc. */ |
| 112 | 112 |
| 113 int consing_since_gc; | 113 int consing_since_gc; |
| 114 | 114 |
| 1444 | 1444 |
| 1445 int | 1445 int |
| 1446 string_bytes (s) | 1446 string_bytes (s) |
| 1447 struct Lisp_String *s; | 1447 struct Lisp_String *s; |
| 1448 { | 1448 { |
| 1449 int nbytes = (s->size_byte < 0 ? s->size & ~MARKBIT : s->size_byte); | 1449 int nbytes = (s->size_byte < 0 ? s->size & ~ARRAY_MARK_FLAG : s->size_byte); |
| 1450 if (!PURE_POINTER_P (s) | 1450 if (!PURE_POINTER_P (s) |
| 1451 && s->data | 1451 && s->data |
| 1452 && nbytes != SDATA_NBYTES (SDATA_OF_STRING (s))) | 1452 && nbytes != SDATA_NBYTES (SDATA_OF_STRING (s))) |
| 1453 abort (); | 1453 abort (); |
| 1454 return nbytes; | 1454 return nbytes; |
