diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c index b891d32d164..0c3f5de6c3e 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3152,11 +3152,27 @@ sweep_vectors (void) | |||
| 3152 | { | 3152 | { |
| 3153 | VECTOR_UNMARK (vector); | 3153 | VECTOR_UNMARK (vector); |
| 3154 | total_vectors++; | 3154 | total_vectors++; |
| 3155 | /* All pseudovectors are small enough to be allocated from | 3155 | if (vector->header.size & PSEUDOVECTOR_FLAG) |
| 3156 | vector blocks. This code should be redesigned if some | 3156 | { |
| 3157 | pseudovector type grows beyond VBLOCK_BYTES_MAX. */ | 3157 | if (((vector->header.size & PVEC_TYPE_MASK) |
| 3158 | eassert (!(vector->header.size & PSEUDOVECTOR_FLAG)); | 3158 | >> PSEUDOVECTOR_SIZE_BITS) == PVEC_BOOL_VECTOR) |
| 3159 | total_vector_bytes += header_size + vector->header.size * word_size; | 3159 | { |
| 3160 | struct Lisp_Bool_Vector *b | ||
| 3161 | = (struct Lisp_Bool_Vector *) vector; | ||
| 3162 | total_vector_bytes += header_size + sizeof (b->size) | ||
| 3163 | + (b->size + BOOL_VECTOR_BITS_PER_CHAR - 1) | ||
| 3164 | / BOOL_VECTOR_BITS_PER_CHAR; | ||
| 3165 | } | ||
| 3166 | else | ||
| 3167 | /* All other pseudovectors are small enough to be | ||
| 3168 | allocated from vector blocks. This code should | ||
| 3169 | be redesigned if some pseudovector type grows | ||
| 3170 | beyond VBLOCK_BYTES_MAX. */ | ||
| 3171 | abort (); | ||
| 3172 | } | ||
| 3173 | else | ||
| 3174 | total_vector_bytes | ||
| 3175 | += header_size + vector->header.size * word_size; | ||
| 3160 | vprev = &vector->header.next.vector; | 3176 | vprev = &vector->header.next.vector; |
| 3161 | } | 3177 | } |
| 3162 | else | 3178 | else |