Mercurial > emacs
comparison src/alloc.c @ 51770:ad47aa3ee2d7
(mark_object): Change arg to only take Lisp_Object rather than *Lisp_Object.
(last_marked): Change accordingly.
(mark_interval, mark_maybe_object, mark_maybe_pointer)
(Fgarbage_collect, mark_glyph_matrix, mark_face_cache, mark_image)
(mark_buffer): Update calls to mark_object.
| author | Stefan Monnier <monnier@iro.umontreal.ca> |
|---|---|
| date | Sun, 06 Jul 2003 19:34:03 +0000 |
| parents | ff38ea4b40ed |
| children | f01acdb936f9 |
comparison
equal
deleted
inserted
replaced
| 51769:8f6662a00b7f | 51770:ad47aa3ee2d7 |
|---|---|
| 1162 register INTERVAL i; | 1162 register INTERVAL i; |
| 1163 Lisp_Object dummy; | 1163 Lisp_Object dummy; |
| 1164 { | 1164 { |
| 1165 eassert (!i->gcmarkbit); /* Intervals are never shared. */ | 1165 eassert (!i->gcmarkbit); /* Intervals are never shared. */ |
| 1166 i->gcmarkbit = 1; | 1166 i->gcmarkbit = 1; |
| 1167 mark_object (&i->plist); | 1167 mark_object (i->plist); |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 | 1170 |
| 1171 /* Mark the interval tree rooted in TREE. Don't call this directly; | 1171 /* Mark the interval tree rooted in TREE. Don't call this directly; |
| 1172 use the macro MARK_INTERVAL_TREE instead. */ | 1172 use the macro MARK_INTERVAL_TREE instead. */ |
| 3644 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES | 3644 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES |
| 3645 if (nzombies < MAX_ZOMBIES) | 3645 if (nzombies < MAX_ZOMBIES) |
| 3646 zombies[nzombies] = obj; | 3646 zombies[nzombies] = obj; |
| 3647 ++nzombies; | 3647 ++nzombies; |
| 3648 #endif | 3648 #endif |
| 3649 mark_object (&obj); | 3649 mark_object (obj); |
| 3650 } | 3650 } |
| 3651 } | 3651 } |
| 3652 } | 3652 } |
| 3653 | 3653 |
| 3654 | 3654 |
| 3726 default: | 3726 default: |
| 3727 abort (); | 3727 abort (); |
| 3728 } | 3728 } |
| 3729 | 3729 |
| 3730 if (!GC_NILP (obj)) | 3730 if (!GC_NILP (obj)) |
| 3731 mark_object (&obj); | 3731 mark_object (obj); |
| 3732 } | 3732 } |
| 3733 } | 3733 } |
| 3734 | 3734 |
| 3735 | 3735 |
| 3736 /* Mark Lisp objects referenced from the address range START..END. */ | 3736 /* Mark Lisp objects referenced from the address range START..END. */ |
| 4368 Then we know no slot is marked twice because the structures don't overlap. | 4368 Then we know no slot is marked twice because the structures don't overlap. |
| 4369 In some cases, the structures point to the slots to be marked. | 4369 In some cases, the structures point to the slots to be marked. |
| 4370 For these, we use MARKBIT to avoid double marking of the slot. */ | 4370 For these, we use MARKBIT to avoid double marking of the slot. */ |
| 4371 | 4371 |
| 4372 for (i = 0; i < staticidx; i++) | 4372 for (i = 0; i < staticidx; i++) |
| 4373 mark_object (staticvec[i]); | 4373 mark_object (*staticvec[i]); |
| 4374 | 4374 |
| 4375 #if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \ | 4375 #if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \ |
| 4376 || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) | 4376 || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) |
| 4377 mark_stack (); | 4377 mark_stack (); |
| 4378 #else | 4378 #else |
| 4382 for (i = 0; i < tail->nvars; i++) | 4382 for (i = 0; i < tail->nvars; i++) |
| 4383 if (!XMARKBIT (tail->var[i])) | 4383 if (!XMARKBIT (tail->var[i])) |
| 4384 { | 4384 { |
| 4385 /* Explicit casting prevents compiler warning about | 4385 /* Explicit casting prevents compiler warning about |
| 4386 discarding the `volatile' qualifier. */ | 4386 discarding the `volatile' qualifier. */ |
| 4387 mark_object ((Lisp_Object *)&tail->var[i]); | 4387 mark_object (tail->var[i]); |
| 4388 XMARK (tail->var[i]); | 4388 XMARK (tail->var[i]); |
| 4389 } | 4389 } |
| 4390 } | 4390 } |
| 4391 #endif | 4391 #endif |
| 4392 | 4392 |
| 4393 mark_byte_stack (); | 4393 mark_byte_stack (); |
| 4394 for (bind = specpdl; bind != specpdl_ptr; bind++) | 4394 for (bind = specpdl; bind != specpdl_ptr; bind++) |
| 4395 { | 4395 { |
| 4396 /* These casts avoid a warning for discarding `volatile'. */ | 4396 /* These casts avoid a warning for discarding `volatile'. */ |
| 4397 mark_object ((Lisp_Object *) &bind->symbol); | 4397 mark_object (bind->symbol); |
| 4398 mark_object ((Lisp_Object *) &bind->old_value); | 4398 mark_object (bind->old_value); |
| 4399 } | 4399 } |
| 4400 for (catch = catchlist; catch; catch = catch->next) | 4400 for (catch = catchlist; catch; catch = catch->next) |
| 4401 { | 4401 { |
| 4402 mark_object (&catch->tag); | 4402 mark_object (catch->tag); |
| 4403 mark_object (&catch->val); | 4403 mark_object (catch->val); |
| 4404 } | 4404 } |
| 4405 for (handler = handlerlist; handler; handler = handler->next) | 4405 for (handler = handlerlist; handler; handler = handler->next) |
| 4406 { | 4406 { |
| 4407 mark_object (&handler->handler); | 4407 mark_object (handler->handler); |
| 4408 mark_object (&handler->var); | 4408 mark_object (handler->var); |
| 4409 } | 4409 } |
| 4410 for (backlist = backtrace_list; backlist; backlist = backlist->next) | 4410 for (backlist = backtrace_list; backlist; backlist = backlist->next) |
| 4411 { | 4411 { |
| 4412 if (!XMARKBIT (*backlist->function)) | 4412 if (!XMARKBIT (*backlist->function)) |
| 4413 { | 4413 { |
| 4414 mark_object (backlist->function); | 4414 mark_object (*backlist->function); |
| 4415 XMARK (*backlist->function); | 4415 XMARK (*backlist->function); |
| 4416 } | 4416 } |
| 4417 if (backlist->nargs == UNEVALLED || backlist->nargs == MANY) | 4417 if (backlist->nargs == UNEVALLED || backlist->nargs == MANY) |
| 4418 i = 0; | 4418 i = 0; |
| 4419 else | 4419 else |
| 4420 i = backlist->nargs - 1; | 4420 i = backlist->nargs - 1; |
| 4421 for (; i >= 0; i--) | 4421 for (; i >= 0; i--) |
| 4422 if (!XMARKBIT (backlist->args[i])) | 4422 if (!XMARKBIT (backlist->args[i])) |
| 4423 { | 4423 { |
| 4424 mark_object (&backlist->args[i]); | 4424 mark_object (backlist->args[i]); |
| 4425 XMARK (backlist->args[i]); | 4425 XMARK (backlist->args[i]); |
| 4426 } | 4426 } |
| 4427 } | 4427 } |
| 4428 mark_kboards (); | 4428 mark_kboards (); |
| 4429 | 4429 |
| 4605 struct glyph *end_glyph = glyph + row->used[area]; | 4605 struct glyph *end_glyph = glyph + row->used[area]; |
| 4606 | 4606 |
| 4607 for (; glyph < end_glyph; ++glyph) | 4607 for (; glyph < end_glyph; ++glyph) |
| 4608 if (GC_STRINGP (glyph->object) | 4608 if (GC_STRINGP (glyph->object) |
| 4609 && !STRING_MARKED_P (XSTRING (glyph->object))) | 4609 && !STRING_MARKED_P (XSTRING (glyph->object))) |
| 4610 mark_object (&glyph->object); | 4610 mark_object (glyph->object); |
| 4611 } | 4611 } |
| 4612 } | 4612 } |
| 4613 } | 4613 } |
| 4614 | 4614 |
| 4615 | 4615 |
| 4627 struct face *face = FACE_FROM_ID (c->f, i); | 4627 struct face *face = FACE_FROM_ID (c->f, i); |
| 4628 | 4628 |
| 4629 if (face) | 4629 if (face) |
| 4630 { | 4630 { |
| 4631 for (j = 0; j < LFACE_VECTOR_SIZE; ++j) | 4631 for (j = 0; j < LFACE_VECTOR_SIZE; ++j) |
| 4632 mark_object (&face->lface[j]); | 4632 mark_object (face->lface[j]); |
| 4633 } | 4633 } |
| 4634 } | 4634 } |
| 4635 } | 4635 } |
| 4636 } | 4636 } |
| 4637 | 4637 |
| 4642 | 4642 |
| 4643 static void | 4643 static void |
| 4644 mark_image (img) | 4644 mark_image (img) |
| 4645 struct image *img; | 4645 struct image *img; |
| 4646 { | 4646 { |
| 4647 mark_object (&img->spec); | 4647 mark_object (img->spec); |
| 4648 | 4648 |
| 4649 if (!NILP (img->data.lisp_val)) | 4649 if (!NILP (img->data.lisp_val)) |
| 4650 mark_object (&img->data.lisp_val); | 4650 mark_object (img->data.lisp_val); |
| 4651 } | 4651 } |
| 4652 | 4652 |
| 4653 | 4653 |
| 4654 /* Mark Lisp objects in image cache of frame F. It's done this way so | 4654 /* Mark Lisp objects in image cache of frame F. It's done this way so |
| 4655 that we don't have to include xterm.h here. */ | 4655 that we don't have to include xterm.h here. */ |
| 4668 /* Mark reference to a Lisp_Object. | 4668 /* Mark reference to a Lisp_Object. |
| 4669 If the object referred to has not been seen yet, recursively mark | 4669 If the object referred to has not been seen yet, recursively mark |
| 4670 all the references contained in it. */ | 4670 all the references contained in it. */ |
| 4671 | 4671 |
| 4672 #define LAST_MARKED_SIZE 500 | 4672 #define LAST_MARKED_SIZE 500 |
| 4673 Lisp_Object *last_marked[LAST_MARKED_SIZE]; | 4673 Lisp_Object last_marked[LAST_MARKED_SIZE]; |
| 4674 int last_marked_index; | 4674 int last_marked_index; |
| 4675 | 4675 |
| 4676 /* For debugging--call abort when we cdr down this many | 4676 /* For debugging--call abort when we cdr down this many |
| 4677 links of a list, in mark_object. In debugging, | 4677 links of a list, in mark_object. In debugging, |
| 4678 the call to abort will hit a breakpoint. | 4678 the call to abort will hit a breakpoint. |
| 4679 Normally this is zero and the check never goes off. */ | 4679 Normally this is zero and the check never goes off. */ |
| 4680 int mark_object_loop_halt; | 4680 int mark_object_loop_halt; |
| 4681 | 4681 |
| 4682 void | 4682 void |
| 4683 mark_object (argptr) | 4683 mark_object (arg) |
| 4684 Lisp_Object *argptr; | 4684 Lisp_Object arg; |
| 4685 { | 4685 { |
| 4686 Lisp_Object *objptr = argptr; | 4686 register Lisp_Object obj = arg; |
| 4687 register Lisp_Object obj; | |
| 4688 #ifdef GC_CHECK_MARKED_OBJECTS | 4687 #ifdef GC_CHECK_MARKED_OBJECTS |
| 4689 void *po; | 4688 void *po; |
| 4690 struct mem_node *m; | 4689 struct mem_node *m; |
| 4691 #endif | 4690 #endif |
| 4692 int cdr_count = 0; | 4691 int cdr_count = 0; |
| 4693 | 4692 |
| 4694 loop: | 4693 loop: |
| 4695 obj = *objptr; | |
| 4696 loop2: | |
| 4697 XUNMARK (obj); | 4694 XUNMARK (obj); |
| 4698 | 4695 |
| 4699 if (PURE_POINTER_P (XPNTR (obj))) | 4696 if (PURE_POINTER_P (XPNTR (obj))) |
| 4700 return; | 4697 return; |
| 4701 | 4698 |
| 4702 last_marked[last_marked_index++] = objptr; | 4699 last_marked[last_marked_index++] = obj; |
| 4703 if (last_marked_index == LAST_MARKED_SIZE) | 4700 if (last_marked_index == LAST_MARKED_SIZE) |
| 4704 last_marked_index = 0; | 4701 last_marked_index = 0; |
| 4705 | 4702 |
| 4706 /* Perform some sanity checks on the objects marked here. Abort if | 4703 /* Perform some sanity checks on the objects marked here. Abort if |
| 4707 we encounter an object we know is bogus. This increases GC time | 4704 we encounter an object we know is bogus. This increases GC time |
| 4802 VECTOR_MARK (ptr); /* Else mark it */ | 4799 VECTOR_MARK (ptr); /* Else mark it */ |
| 4803 size &= PSEUDOVECTOR_SIZE_MASK; | 4800 size &= PSEUDOVECTOR_SIZE_MASK; |
| 4804 for (i = 0; i < size; i++) /* and then mark its elements */ | 4801 for (i = 0; i < size; i++) /* and then mark its elements */ |
| 4805 { | 4802 { |
| 4806 if (i != COMPILED_CONSTANTS) | 4803 if (i != COMPILED_CONSTANTS) |
| 4807 mark_object (&ptr->contents[i]); | 4804 mark_object (ptr->contents[i]); |
| 4808 } | 4805 } |
| 4809 /* This cast should be unnecessary, but some Mips compiler complains | 4806 obj = ptr->contents[COMPILED_CONSTANTS]; |
| 4810 (MIPS-ABI + SysVR4, DC/OSx, etc). */ | |
| 4811 objptr = (Lisp_Object *) &ptr->contents[COMPILED_CONSTANTS]; | |
| 4812 goto loop; | 4807 goto loop; |
| 4813 } | 4808 } |
| 4814 else if (GC_FRAMEP (obj)) | 4809 else if (GC_FRAMEP (obj)) |
| 4815 { | 4810 { |
| 4816 register struct frame *ptr = XFRAME (obj); | 4811 register struct frame *ptr = XFRAME (obj); |
| 4817 | 4812 |
| 4818 if (VECTOR_MARKED_P (ptr)) break; /* Already marked */ | 4813 if (VECTOR_MARKED_P (ptr)) break; /* Already marked */ |
| 4819 VECTOR_MARK (ptr); /* Else mark it */ | 4814 VECTOR_MARK (ptr); /* Else mark it */ |
| 4820 | 4815 |
| 4821 CHECK_LIVE (live_vector_p); | 4816 CHECK_LIVE (live_vector_p); |
| 4822 mark_object (&ptr->name); | 4817 mark_object (ptr->name); |
| 4823 mark_object (&ptr->icon_name); | 4818 mark_object (ptr->icon_name); |
| 4824 mark_object (&ptr->title); | 4819 mark_object (ptr->title); |
| 4825 mark_object (&ptr->focus_frame); | 4820 mark_object (ptr->focus_frame); |
| 4826 mark_object (&ptr->selected_window); | 4821 mark_object (ptr->selected_window); |
| 4827 mark_object (&ptr->minibuffer_window); | 4822 mark_object (ptr->minibuffer_window); |
| 4828 mark_object (&ptr->param_alist); | 4823 mark_object (ptr->param_alist); |
| 4829 mark_object (&ptr->scroll_bars); | 4824 mark_object (ptr->scroll_bars); |
| 4830 mark_object (&ptr->condemned_scroll_bars); | 4825 mark_object (ptr->condemned_scroll_bars); |
| 4831 mark_object (&ptr->menu_bar_items); | 4826 mark_object (ptr->menu_bar_items); |
| 4832 mark_object (&ptr->face_alist); | 4827 mark_object (ptr->face_alist); |
| 4833 mark_object (&ptr->menu_bar_vector); | 4828 mark_object (ptr->menu_bar_vector); |
| 4834 mark_object (&ptr->buffer_predicate); | 4829 mark_object (ptr->buffer_predicate); |
| 4835 mark_object (&ptr->buffer_list); | 4830 mark_object (ptr->buffer_list); |
| 4836 mark_object (&ptr->menu_bar_window); | 4831 mark_object (ptr->menu_bar_window); |
| 4837 mark_object (&ptr->tool_bar_window); | 4832 mark_object (ptr->tool_bar_window); |
| 4838 mark_face_cache (ptr->face_cache); | 4833 mark_face_cache (ptr->face_cache); |
| 4839 #ifdef HAVE_WINDOW_SYSTEM | 4834 #ifdef HAVE_WINDOW_SYSTEM |
| 4840 mark_image_cache (ptr); | 4835 mark_image_cache (ptr); |
| 4841 mark_object (&ptr->tool_bar_items); | 4836 mark_object (ptr->tool_bar_items); |
| 4842 mark_object (&ptr->desired_tool_bar_string); | 4837 mark_object (ptr->desired_tool_bar_string); |
| 4843 mark_object (&ptr->current_tool_bar_string); | 4838 mark_object (ptr->current_tool_bar_string); |
| 4844 #endif /* HAVE_WINDOW_SYSTEM */ | 4839 #endif /* HAVE_WINDOW_SYSTEM */ |
| 4845 } | 4840 } |
| 4846 else if (GC_BOOL_VECTOR_P (obj)) | 4841 else if (GC_BOOL_VECTOR_P (obj)) |
| 4847 { | 4842 { |
| 4848 register struct Lisp_Vector *ptr = XVECTOR (obj); | 4843 register struct Lisp_Vector *ptr = XVECTOR (obj); |
| 4869 /* There is no Lisp data above The member CURRENT_MATRIX in | 4864 /* There is no Lisp data above The member CURRENT_MATRIX in |
| 4870 struct WINDOW. Stop marking when that slot is reached. */ | 4865 struct WINDOW. Stop marking when that slot is reached. */ |
| 4871 for (i = 0; | 4866 for (i = 0; |
| 4872 (char *) &ptr->contents[i] < (char *) &w->current_matrix; | 4867 (char *) &ptr->contents[i] < (char *) &w->current_matrix; |
| 4873 i++) | 4868 i++) |
| 4874 mark_object (&ptr->contents[i]); | 4869 mark_object (ptr->contents[i]); |
| 4875 | 4870 |
| 4876 /* Mark glyphs for leaf windows. Marking window matrices is | 4871 /* Mark glyphs for leaf windows. Marking window matrices is |
| 4877 sufficient because frame matrices use the same glyph | 4872 sufficient because frame matrices use the same glyph |
| 4878 memory. */ | 4873 memory. */ |
| 4879 if (NILP (w->hchild) | 4874 if (NILP (w->hchild) |
| 4899 /* Mark contents. */ | 4894 /* Mark contents. */ |
| 4900 /* Do not mark next_free or next_weak. | 4895 /* Do not mark next_free or next_weak. |
| 4901 Being in the next_weak chain | 4896 Being in the next_weak chain |
| 4902 should not keep the hash table alive. | 4897 should not keep the hash table alive. |
| 4903 No need to mark `count' since it is an integer. */ | 4898 No need to mark `count' since it is an integer. */ |
| 4904 mark_object (&h->test); | 4899 mark_object (h->test); |
| 4905 mark_object (&h->weak); | 4900 mark_object (h->weak); |
| 4906 mark_object (&h->rehash_size); | 4901 mark_object (h->rehash_size); |
| 4907 mark_object (&h->rehash_threshold); | 4902 mark_object (h->rehash_threshold); |
| 4908 mark_object (&h->hash); | 4903 mark_object (h->hash); |
| 4909 mark_object (&h->next); | 4904 mark_object (h->next); |
| 4910 mark_object (&h->index); | 4905 mark_object (h->index); |
| 4911 mark_object (&h->user_hash_function); | 4906 mark_object (h->user_hash_function); |
| 4912 mark_object (&h->user_cmp_function); | 4907 mark_object (h->user_cmp_function); |
| 4913 | 4908 |
| 4914 /* If hash table is not weak, mark all keys and values. | 4909 /* If hash table is not weak, mark all keys and values. |
| 4915 For weak tables, mark only the vector. */ | 4910 For weak tables, mark only the vector. */ |
| 4916 if (GC_NILP (h->weak)) | 4911 if (GC_NILP (h->weak)) |
| 4917 mark_object (&h->key_and_value); | 4912 mark_object (h->key_and_value); |
| 4918 else | 4913 else |
| 4919 VECTOR_MARK (XVECTOR (h->key_and_value)); | 4914 VECTOR_MARK (XVECTOR (h->key_and_value)); |
| 4920 } | 4915 } |
| 4921 else | 4916 else |
| 4922 { | 4917 { |
| 4929 VECTOR_MARK (ptr); /* Else mark it */ | 4924 VECTOR_MARK (ptr); /* Else mark it */ |
| 4930 if (size & PSEUDOVECTOR_FLAG) | 4925 if (size & PSEUDOVECTOR_FLAG) |
| 4931 size &= PSEUDOVECTOR_SIZE_MASK; | 4926 size &= PSEUDOVECTOR_SIZE_MASK; |
| 4932 | 4927 |
| 4933 for (i = 0; i < size; i++) /* and then mark its elements */ | 4928 for (i = 0; i < size; i++) /* and then mark its elements */ |
| 4934 mark_object (&ptr->contents[i]); | 4929 mark_object (ptr->contents[i]); |
| 4935 } | 4930 } |
| 4936 break; | 4931 break; |
| 4937 | 4932 |
| 4938 case Lisp_Symbol: | 4933 case Lisp_Symbol: |
| 4939 { | 4934 { |
| 4941 struct Lisp_Symbol *ptrx; | 4936 struct Lisp_Symbol *ptrx; |
| 4942 | 4937 |
| 4943 if (ptr->gcmarkbit) break; | 4938 if (ptr->gcmarkbit) break; |
| 4944 CHECK_ALLOCATED_AND_LIVE (live_symbol_p); | 4939 CHECK_ALLOCATED_AND_LIVE (live_symbol_p); |
| 4945 ptr->gcmarkbit = 1; | 4940 ptr->gcmarkbit = 1; |
| 4946 mark_object ((Lisp_Object *) &ptr->value); | 4941 mark_object (ptr->value); |
| 4947 mark_object (&ptr->function); | 4942 mark_object (ptr->function); |
| 4948 mark_object (&ptr->plist); | 4943 mark_object (ptr->plist); |
| 4949 | 4944 |
| 4950 if (!PURE_POINTER_P (XSTRING (ptr->xname))) | 4945 if (!PURE_POINTER_P (XSTRING (ptr->xname))) |
| 4951 MARK_STRING (XSTRING (ptr->xname)); | 4946 MARK_STRING (XSTRING (ptr->xname)); |
| 4952 MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname)); | 4947 MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname)); |
| 4953 | 4948 |
| 4955 It is safe not to do so because nothing accesses that | 4950 It is safe not to do so because nothing accesses that |
| 4956 slot except to check whether it is nil. */ | 4951 slot except to check whether it is nil. */ |
| 4957 ptr = ptr->next; | 4952 ptr = ptr->next; |
| 4958 if (ptr) | 4953 if (ptr) |
| 4959 { | 4954 { |
| 4960 /* For the benefit of the last_marked log. */ | |
| 4961 objptr = (Lisp_Object *)&XSYMBOL (obj)->next; | |
| 4962 ptrx = ptr; /* Use of ptrx avoids compiler bug on Sun */ | 4955 ptrx = ptr; /* Use of ptrx avoids compiler bug on Sun */ |
| 4963 XSETSYMBOL (obj, ptrx); | 4956 XSETSYMBOL (obj, ptrx); |
| 4964 /* We can't goto loop here because *objptr doesn't contain an | 4957 goto loop; |
| 4965 actual Lisp_Object with valid datatype field. */ | |
| 4966 goto loop2; | |
| 4967 } | 4958 } |
| 4968 } | 4959 } |
| 4969 break; | 4960 break; |
| 4970 | 4961 |
| 4971 case Lisp_Misc: | 4962 case Lisp_Misc: |
| 4981 register struct Lisp_Buffer_Local_Value *ptr | 4972 register struct Lisp_Buffer_Local_Value *ptr |
| 4982 = XBUFFER_LOCAL_VALUE (obj); | 4973 = XBUFFER_LOCAL_VALUE (obj); |
| 4983 /* If the cdr is nil, avoid recursion for the car. */ | 4974 /* If the cdr is nil, avoid recursion for the car. */ |
| 4984 if (EQ (ptr->cdr, Qnil)) | 4975 if (EQ (ptr->cdr, Qnil)) |
| 4985 { | 4976 { |
| 4986 objptr = &ptr->realvalue; | 4977 obj = ptr->realvalue; |
| 4987 goto loop; | 4978 goto loop; |
| 4988 } | 4979 } |
| 4989 mark_object (&ptr->realvalue); | 4980 mark_object (ptr->realvalue); |
| 4990 mark_object (&ptr->buffer); | 4981 mark_object (ptr->buffer); |
| 4991 mark_object (&ptr->frame); | 4982 mark_object (ptr->frame); |
| 4992 objptr = &ptr->cdr; | 4983 obj = ptr->cdr; |
| 4993 goto loop; | 4984 goto loop; |
| 4994 } | 4985 } |
| 4995 | 4986 |
| 4996 case Lisp_Misc_Marker: | 4987 case Lisp_Misc_Marker: |
| 4997 /* DO NOT mark thru the marker's chain. | 4988 /* DO NOT mark thru the marker's chain. |
| 5009 break; | 5000 break; |
| 5010 | 5001 |
| 5011 case Lisp_Misc_Overlay: | 5002 case Lisp_Misc_Overlay: |
| 5012 { | 5003 { |
| 5013 struct Lisp_Overlay *ptr = XOVERLAY (obj); | 5004 struct Lisp_Overlay *ptr = XOVERLAY (obj); |
| 5014 mark_object (&ptr->start); | 5005 mark_object (ptr->start); |
| 5015 mark_object (&ptr->end); | 5006 mark_object (ptr->end); |
| 5016 objptr = &ptr->plist; | 5007 obj = ptr->plist; |
| 5017 goto loop; | 5008 goto loop; |
| 5018 } | 5009 } |
| 5019 break; | 5010 break; |
| 5020 | 5011 |
| 5021 default: | 5012 default: |
| 5030 CHECK_ALLOCATED_AND_LIVE (live_cons_p); | 5021 CHECK_ALLOCATED_AND_LIVE (live_cons_p); |
| 5031 XMARK (ptr->car); | 5022 XMARK (ptr->car); |
| 5032 /* If the cdr is nil, avoid recursion for the car. */ | 5023 /* If the cdr is nil, avoid recursion for the car. */ |
| 5033 if (EQ (ptr->cdr, Qnil)) | 5024 if (EQ (ptr->cdr, Qnil)) |
| 5034 { | 5025 { |
| 5035 objptr = &ptr->car; | 5026 obj = ptr->car; |
| 5036 cdr_count = 0; | 5027 cdr_count = 0; |
| 5037 goto loop; | 5028 goto loop; |
| 5038 } | 5029 } |
| 5039 mark_object (&ptr->car); | 5030 mark_object (ptr->car); |
| 5040 objptr = &ptr->cdr; | 5031 obj = ptr->cdr; |
| 5041 cdr_count++; | 5032 cdr_count++; |
| 5042 if (cdr_count == mark_object_loop_halt) | 5033 if (cdr_count == mark_object_loop_halt) |
| 5043 abort (); | 5034 abort (); |
| 5044 goto loop; | 5035 goto loop; |
| 5045 } | 5036 } |
| 5093 if (GC_CONSP (ptr->car) | 5084 if (GC_CONSP (ptr->car) |
| 5094 && ! XMARKBIT (XCAR (ptr->car)) | 5085 && ! XMARKBIT (XCAR (ptr->car)) |
| 5095 && GC_MARKERP (XCAR (ptr->car))) | 5086 && GC_MARKERP (XCAR (ptr->car))) |
| 5096 { | 5087 { |
| 5097 XMARK (XCAR_AS_LVALUE (ptr->car)); | 5088 XMARK (XCAR_AS_LVALUE (ptr->car)); |
| 5098 mark_object (&XCDR_AS_LVALUE (ptr->car)); | 5089 mark_object (XCDR (ptr->car)); |
| 5099 } | 5090 } |
| 5100 else | 5091 else |
| 5101 mark_object (&ptr->car); | 5092 mark_object (ptr->car); |
| 5102 | 5093 |
| 5103 if (CONSP (ptr->cdr)) | 5094 if (CONSP (ptr->cdr)) |
| 5104 tail = ptr->cdr; | 5095 tail = ptr->cdr; |
| 5105 else | 5096 else |
| 5106 break; | 5097 break; |
| 5107 } | 5098 } |
| 5108 | 5099 |
| 5109 mark_object (&XCDR_AS_LVALUE (tail)); | 5100 mark_object (XCDR (tail)); |
| 5110 } | 5101 } |
| 5111 else | 5102 else |
| 5112 mark_object (&buffer->undo_list); | 5103 mark_object (buffer->undo_list); |
| 5113 | 5104 |
| 5114 for (ptr = &buffer->name; | 5105 for (ptr = &buffer->name; |
| 5115 (char *)ptr < (char *)buffer + sizeof (struct buffer); | 5106 (char *)ptr < (char *)buffer + sizeof (struct buffer); |
| 5116 ptr++) | 5107 ptr++) |
| 5117 mark_object (ptr); | 5108 mark_object (*ptr); |
| 5118 | 5109 |
| 5119 /* If this is an indirect buffer, mark its base buffer. */ | 5110 /* If this is an indirect buffer, mark its base buffer. */ |
| 5120 if (buffer->base_buffer && !VECTOR_MARKED_P (buffer->base_buffer)) | 5111 if (buffer->base_buffer && !VECTOR_MARKED_P (buffer->base_buffer)) |
| 5121 { | 5112 { |
| 5122 XSETBUFFER (base_buffer, buffer->base_buffer); | 5113 XSETBUFFER (base_buffer, buffer->base_buffer); |
