diff options
| author | Joakim Verona | 2012-08-01 13:16:20 +0200 |
|---|---|---|
| committer | Joakim Verona | 2012-08-01 13:16:20 +0200 |
| commit | 610ba6f8ddf2298849cad522b6952bc694f0e63f (patch) | |
| tree | 64548d6651c0501eb5838c566a6902d500228b5f /src/alloc.c | |
| parent | 55fa71b3d9bb8609ca3cbb56f92c776ad8724a69 (diff) | |
| parent | 069bac5e5b55c0f63bd2764e727108d2b48b2643 (diff) | |
| download | emacs-610ba6f8ddf2298849cad522b6952bc694f0e63f.tar.gz emacs-610ba6f8ddf2298849cad522b6952bc694f0e63f.zip | |
upstream
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/src/alloc.c b/src/alloc.c index 5b2553c69cc..2d5149a6772 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2686,7 +2686,7 @@ free_cons (struct Lisp_Cons *ptr) | |||
| 2686 | { | 2686 | { |
| 2687 | ptr->u.chain = cons_free_list; | 2687 | ptr->u.chain = cons_free_list; |
| 2688 | #if GC_MARK_STACK | 2688 | #if GC_MARK_STACK |
| 2689 | ptr->car = Vdead; | 2689 | CVAR (ptr, car) = Vdead; |
| 2690 | #endif | 2690 | #endif |
| 2691 | cons_free_list = ptr; | 2691 | cons_free_list = ptr; |
| 2692 | consing_since_gc -= sizeof *ptr; | 2692 | consing_since_gc -= sizeof *ptr; |
| @@ -3518,11 +3518,11 @@ Its value and function definition are void, and its property list is nil. */) | |||
| 3518 | MALLOC_UNBLOCK_INPUT; | 3518 | MALLOC_UNBLOCK_INPUT; |
| 3519 | 3519 | ||
| 3520 | p = XSYMBOL (val); | 3520 | p = XSYMBOL (val); |
| 3521 | p->xname = name; | 3521 | SVAR (p, xname) = name; |
| 3522 | p->plist = Qnil; | 3522 | SVAR (p, plist) = Qnil; |
| 3523 | p->redirect = SYMBOL_PLAINVAL; | 3523 | p->redirect = SYMBOL_PLAINVAL; |
| 3524 | SET_SYMBOL_VAL (p, Qunbound); | 3524 | SET_SYMBOL_VAL (p, Qunbound); |
| 3525 | p->function = Qunbound; | 3525 | SVAR (p, function) = Qunbound; |
| 3526 | p->next = NULL; | 3526 | p->next = NULL; |
| 3527 | p->gcmarkbit = 0; | 3527 | p->gcmarkbit = 0; |
| 3528 | p->interned = SYMBOL_UNINTERNED; | 3528 | p->interned = SYMBOL_UNINTERNED; |
| @@ -4295,7 +4295,7 @@ live_cons_p (struct mem_node *m, void *p) | |||
| 4295 | && offset < (CONS_BLOCK_SIZE * sizeof b->conses[0]) | 4295 | && offset < (CONS_BLOCK_SIZE * sizeof b->conses[0]) |
| 4296 | && (b != cons_block | 4296 | && (b != cons_block |
| 4297 | || offset / sizeof b->conses[0] < cons_block_index) | 4297 | || offset / sizeof b->conses[0] < cons_block_index) |
| 4298 | && !EQ (((struct Lisp_Cons *) p)->car, Vdead)); | 4298 | && !EQ (CVAR ((struct Lisp_Cons *) p, car), Vdead)); |
| 4299 | } | 4299 | } |
| 4300 | else | 4300 | else |
| 4301 | return 0; | 4301 | return 0; |
| @@ -4321,7 +4321,7 @@ live_symbol_p (struct mem_node *m, void *p) | |||
| 4321 | && offset < (SYMBOL_BLOCK_SIZE * sizeof b->symbols[0]) | 4321 | && offset < (SYMBOL_BLOCK_SIZE * sizeof b->symbols[0]) |
| 4322 | && (b != symbol_block | 4322 | && (b != symbol_block |
| 4323 | || offset / sizeof b->symbols[0] < symbol_block_index) | 4323 | || offset / sizeof b->symbols[0] < symbol_block_index) |
| 4324 | && !EQ (((struct Lisp_Symbol *) p)->function, Vdead)); | 4324 | && !EQ (SVAR (((struct Lisp_Symbol *)p), function), Vdead)); |
| 4325 | } | 4325 | } |
| 4326 | else | 4326 | else |
| 4327 | return 0; | 4327 | return 0; |
| @@ -4424,7 +4424,7 @@ live_buffer_p (struct mem_node *m, void *p) | |||
| 4424 | must not have been killed. */ | 4424 | must not have been killed. */ |
| 4425 | return (m->type == MEM_TYPE_BUFFER | 4425 | return (m->type == MEM_TYPE_BUFFER |
| 4426 | && p == m->start | 4426 | && p == m->start |
| 4427 | && !NILP (((struct buffer *) p)->BUFFER_INTERNAL_FIELD (name))); | 4427 | && !NILP (((struct buffer *) p)->INTERNAL_FIELD (name))); |
| 4428 | } | 4428 | } |
| 4429 | 4429 | ||
| 4430 | #endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */ | 4430 | #endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */ |
| @@ -5549,10 +5549,10 @@ See Info node `(elisp)Garbage Collection'. */) | |||
| 5549 | turned off in that buffer. Calling truncate_undo_list on | 5549 | turned off in that buffer. Calling truncate_undo_list on |
| 5550 | Qt tends to return NULL, which effectively turns undo back on. | 5550 | Qt tends to return NULL, which effectively turns undo back on. |
| 5551 | So don't call truncate_undo_list if undo_list is Qt. */ | 5551 | So don't call truncate_undo_list if undo_list is Qt. */ |
| 5552 | if (! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) | 5552 | if (! EQ (nextb->INTERNAL_FIELD (undo_list), Qt)) |
| 5553 | { | 5553 | { |
| 5554 | Lisp_Object tail, prev; | 5554 | Lisp_Object tail, prev; |
| 5555 | tail = nextb->BUFFER_INTERNAL_FIELD (undo_list); | 5555 | tail = nextb->INTERNAL_FIELD (undo_list); |
| 5556 | prev = Qnil; | 5556 | prev = Qnil; |
| 5557 | while (CONSP (tail)) | 5557 | while (CONSP (tail)) |
| 5558 | { | 5558 | { |
| @@ -5561,7 +5561,7 @@ See Info node `(elisp)Garbage Collection'. */) | |||
| 5561 | && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) | 5561 | && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) |
| 5562 | { | 5562 | { |
| 5563 | if (NILP (prev)) | 5563 | if (NILP (prev)) |
| 5564 | nextb->BUFFER_INTERNAL_FIELD (undo_list) = tail = XCDR (tail); | 5564 | nextb->INTERNAL_FIELD (undo_list) = tail = XCDR (tail); |
| 5565 | else | 5565 | else |
| 5566 | { | 5566 | { |
| 5567 | tail = XCDR (tail); | 5567 | tail = XCDR (tail); |
| @@ -5577,7 +5577,7 @@ See Info node `(elisp)Garbage Collection'. */) | |||
| 5577 | } | 5577 | } |
| 5578 | /* Now that we have stripped the elements that need not be in the | 5578 | /* Now that we have stripped the elements that need not be in the |
| 5579 | undo_list any more, we can finally mark the list. */ | 5579 | undo_list any more, we can finally mark the list. */ |
| 5580 | mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list)); | 5580 | mark_object (nextb->INTERNAL_FIELD (undo_list)); |
| 5581 | } | 5581 | } |
| 5582 | 5582 | ||
| 5583 | gc_sweep (); | 5583 | gc_sweep (); |
| @@ -5837,9 +5837,9 @@ mark_overlay (struct Lisp_Overlay *ptr) | |||
| 5837 | for (; ptr && !ptr->gcmarkbit; ptr = ptr->next) | 5837 | for (; ptr && !ptr->gcmarkbit; ptr = ptr->next) |
| 5838 | { | 5838 | { |
| 5839 | ptr->gcmarkbit = 1; | 5839 | ptr->gcmarkbit = 1; |
| 5840 | mark_object (ptr->start); | 5840 | mark_object (MVAR (ptr, start)); |
| 5841 | mark_object (ptr->end); | 5841 | mark_object (MVAR (ptr, end)); |
| 5842 | mark_object (ptr->plist); | 5842 | mark_object (MVAR (ptr, plist)); |
| 5843 | } | 5843 | } |
| 5844 | } | 5844 | } |
| 5845 | 5845 | ||
| @@ -6020,7 +6020,8 @@ mark_object (Lisp_Object arg) | |||
| 6020 | /* Mark glyphs for leaf windows. Marking window | 6020 | /* Mark glyphs for leaf windows. Marking window |
| 6021 | matrices is sufficient because frame matrices | 6021 | matrices is sufficient because frame matrices |
| 6022 | use the same glyph memory. */ | 6022 | use the same glyph memory. */ |
| 6023 | if (NILP (w->hchild) && NILP (w->vchild) && w->current_matrix) | 6023 | if (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild)) |
| 6024 | && w->current_matrix) | ||
| 6024 | { | 6025 | { |
| 6025 | mark_glyph_matrix (w->current_matrix); | 6026 | mark_glyph_matrix (w->current_matrix); |
| 6026 | mark_glyph_matrix (w->desired_matrix); | 6027 | mark_glyph_matrix (w->desired_matrix); |
| @@ -6072,8 +6073,8 @@ mark_object (Lisp_Object arg) | |||
| 6072 | break; | 6073 | break; |
| 6073 | CHECK_ALLOCATED_AND_LIVE (live_symbol_p); | 6074 | CHECK_ALLOCATED_AND_LIVE (live_symbol_p); |
| 6074 | ptr->gcmarkbit = 1; | 6075 | ptr->gcmarkbit = 1; |
| 6075 | mark_object (ptr->function); | 6076 | mark_object (SVAR (ptr, function)); |
| 6076 | mark_object (ptr->plist); | 6077 | mark_object (SVAR (ptr, plist)); |
| 6077 | switch (ptr->redirect) | 6078 | switch (ptr->redirect) |
| 6078 | { | 6079 | { |
| 6079 | case SYMBOL_PLAINVAL: mark_object (SYMBOL_VAL (ptr)); break; | 6080 | case SYMBOL_PLAINVAL: mark_object (SYMBOL_VAL (ptr)); break; |
| @@ -6104,9 +6105,9 @@ mark_object (Lisp_Object arg) | |||
| 6104 | break; | 6105 | break; |
| 6105 | default: abort (); | 6106 | default: abort (); |
| 6106 | } | 6107 | } |
| 6107 | if (!PURE_POINTER_P (XSTRING (ptr->xname))) | 6108 | if (!PURE_POINTER_P (XSTRING (SVAR (ptr, xname)))) |
| 6108 | MARK_STRING (XSTRING (ptr->xname)); | 6109 | MARK_STRING (XSTRING (SVAR (ptr, xname))); |
| 6109 | MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname)); | 6110 | MARK_INTERVAL_TREE (STRING_INTERVALS (SVAR (ptr, xname))); |
| 6110 | 6111 | ||
| 6111 | ptr = ptr->next; | 6112 | ptr = ptr->next; |
| 6112 | if (ptr) | 6113 | if (ptr) |
| @@ -6168,14 +6169,14 @@ mark_object (Lisp_Object arg) | |||
| 6168 | CHECK_ALLOCATED_AND_LIVE (live_cons_p); | 6169 | CHECK_ALLOCATED_AND_LIVE (live_cons_p); |
| 6169 | CONS_MARK (ptr); | 6170 | CONS_MARK (ptr); |
| 6170 | /* If the cdr is nil, avoid recursion for the car. */ | 6171 | /* If the cdr is nil, avoid recursion for the car. */ |
| 6171 | if (EQ (ptr->u.cdr, Qnil)) | 6172 | if (EQ (CVAR (ptr, u.cdr), Qnil)) |
| 6172 | { | 6173 | { |
| 6173 | obj = ptr->car; | 6174 | obj = CVAR (ptr, car); |
| 6174 | cdr_count = 0; | 6175 | cdr_count = 0; |
| 6175 | goto loop; | 6176 | goto loop; |
| 6176 | } | 6177 | } |
| 6177 | mark_object (ptr->car); | 6178 | mark_object (CVAR (ptr, car)); |
| 6178 | obj = ptr->u.cdr; | 6179 | obj = CVAR (ptr, u.cdr); |
| 6179 | cdr_count++; | 6180 | cdr_count++; |
| 6180 | if (cdr_count == mark_object_loop_halt) | 6181 | if (cdr_count == mark_object_loop_halt) |
| 6181 | abort (); | 6182 | abort (); |
| @@ -6324,7 +6325,7 @@ gc_sweep (void) | |||
| 6324 | cblk->conses[pos].u.chain = cons_free_list; | 6325 | cblk->conses[pos].u.chain = cons_free_list; |
| 6325 | cons_free_list = &cblk->conses[pos]; | 6326 | cons_free_list = &cblk->conses[pos]; |
| 6326 | #if GC_MARK_STACK | 6327 | #if GC_MARK_STACK |
| 6327 | cons_free_list->car = Vdead; | 6328 | CVAR (cons_free_list, car) = Vdead; |
| 6328 | #endif | 6329 | #endif |
| 6329 | } | 6330 | } |
| 6330 | else | 6331 | else |
| @@ -6472,7 +6473,7 @@ gc_sweep (void) | |||
| 6472 | /* Check if the symbol was created during loadup. In such a case | 6473 | /* Check if the symbol was created during loadup. In such a case |
| 6473 | it might be pointed to by pure bytecode which we don't trace, | 6474 | it might be pointed to by pure bytecode which we don't trace, |
| 6474 | so we conservatively assume that it is live. */ | 6475 | so we conservatively assume that it is live. */ |
| 6475 | int pure_p = PURE_POINTER_P (XSTRING (sym->s.xname)); | 6476 | int pure_p = PURE_POINTER_P (XSTRING (sym->s.INTERNAL_FIELD (xname))); |
| 6476 | 6477 | ||
| 6477 | if (!sym->s.gcmarkbit && !pure_p) | 6478 | if (!sym->s.gcmarkbit && !pure_p) |
| 6478 | { | 6479 | { |
| @@ -6481,7 +6482,7 @@ gc_sweep (void) | |||
| 6481 | sym->s.next = symbol_free_list; | 6482 | sym->s.next = symbol_free_list; |
| 6482 | symbol_free_list = &sym->s; | 6483 | symbol_free_list = &sym->s; |
| 6483 | #if GC_MARK_STACK | 6484 | #if GC_MARK_STACK |
| 6484 | symbol_free_list->function = Vdead; | 6485 | SVAR (symbol_free_list, function) = Vdead; |
| 6485 | #endif | 6486 | #endif |
| 6486 | ++this_free; | 6487 | ++this_free; |
| 6487 | } | 6488 | } |
| @@ -6489,7 +6490,7 @@ gc_sweep (void) | |||
| 6489 | { | 6490 | { |
| 6490 | ++num_used; | 6491 | ++num_used; |
| 6491 | if (!pure_p) | 6492 | if (!pure_p) |
| 6492 | UNMARK_STRING (XSTRING (sym->s.xname)); | 6493 | UNMARK_STRING (XSTRING (sym->s.INTERNAL_FIELD (xname))); |
| 6493 | sym->s.gcmarkbit = 0; | 6494 | sym->s.gcmarkbit = 0; |
| 6494 | } | 6495 | } |
| 6495 | } | 6496 | } |
| @@ -6674,10 +6675,10 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max) | |||
| 6674 | XSETSYMBOL (tem, sym); | 6675 | XSETSYMBOL (tem, sym); |
| 6675 | val = find_symbol_value (tem); | 6676 | val = find_symbol_value (tem); |
| 6676 | if (EQ (val, obj) | 6677 | if (EQ (val, obj) |
| 6677 | || EQ (sym->function, obj) | 6678 | || EQ (SVAR (sym, function), obj) |
| 6678 | || (!NILP (sym->function) | 6679 | || (!NILP (SVAR (sym, function)) |
| 6679 | && COMPILEDP (sym->function) | 6680 | && COMPILEDP (SVAR (sym, function)) |
| 6680 | && EQ (AREF (sym->function, COMPILED_BYTECODE), obj)) | 6681 | && EQ (AREF (SVAR (sym, function), COMPILED_BYTECODE), obj)) |
| 6681 | || (!NILP (val) | 6682 | || (!NILP (val) |
| 6682 | && COMPILEDP (val) | 6683 | && COMPILEDP (val) |
| 6683 | && EQ (AREF (val, COMPILED_BYTECODE), obj))) | 6684 | && EQ (AREF (val, COMPILED_BYTECODE), obj))) |