diff options
| author | Stefan Monnier | 2012-07-03 10:37:55 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-07-03 10:37:55 -0400 |
| commit | 7555c33f15ef5ae98508daf9b17b03aea379c78f (patch) | |
| tree | b64021001a7474b69a73ad67a1fa59d3702000cc /src/alloc.c | |
| parent | d12e8f5a194b64e25eb57d5f6ea19f663c0e4f2b (diff) | |
| download | emacs-7555c33f15ef5ae98508daf9b17b03aea379c78f.tar.gz emacs-7555c33f15ef5ae98508daf9b17b03aea379c78f.zip | |
* src/alloc.c (mark_object): Revert part of last patch to use `switch'.
* src/lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/src/alloc.c b/src/alloc.c index 0d4491e8472..19972d54670 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -5730,15 +5730,15 @@ mark_vectorlike (struct Lisp_Vector *ptr) | |||
| 5730 | ptrdiff_t i; | 5730 | ptrdiff_t i; |
| 5731 | 5731 | ||
| 5732 | eassert (!VECTOR_MARKED_P (ptr)); | 5732 | eassert (!VECTOR_MARKED_P (ptr)); |
| 5733 | VECTOR_MARK (ptr); /* Else mark it */ | 5733 | VECTOR_MARK (ptr); /* Else mark it. */ |
| 5734 | if (size & PSEUDOVECTOR_FLAG) | 5734 | if (size & PSEUDOVECTOR_FLAG) |
| 5735 | size &= PSEUDOVECTOR_SIZE_MASK; | 5735 | size &= PSEUDOVECTOR_SIZE_MASK; |
| 5736 | 5736 | ||
| 5737 | /* Note that this size is not the memory-footprint size, but only | 5737 | /* Note that this size is not the memory-footprint size, but only |
| 5738 | the number of Lisp_Object fields that we should trace. | 5738 | the number of Lisp_Object fields that we should trace. |
| 5739 | The distinction is used e.g. by Lisp_Process which places extra | 5739 | The distinction is used e.g. by Lisp_Process which places extra |
| 5740 | non-Lisp_Object fields at the end of the structure. */ | 5740 | non-Lisp_Object fields at the end of the structure... */ |
| 5741 | for (i = 0; i < size; i++) /* and then mark its elements */ | 5741 | for (i = 0; i < size; i++) /* ...and then mark its elements. */ |
| 5742 | mark_object (ptr->contents[i]); | 5742 | mark_object (ptr->contents[i]); |
| 5743 | } | 5743 | } |
| 5744 | 5744 | ||
| @@ -5875,11 +5875,11 @@ mark_object (Lisp_Object arg) | |||
| 5875 | if (STRING_MARKED_P (ptr)) | 5875 | if (STRING_MARKED_P (ptr)) |
| 5876 | break; | 5876 | break; |
| 5877 | CHECK_ALLOCATED_AND_LIVE (live_string_p); | 5877 | CHECK_ALLOCATED_AND_LIVE (live_string_p); |
| 5878 | MARK_INTERVAL_TREE (ptr->intervals); | ||
| 5879 | MARK_STRING (ptr); | 5878 | MARK_STRING (ptr); |
| 5879 | MARK_INTERVAL_TREE (ptr->intervals); | ||
| 5880 | #ifdef GC_CHECK_STRING_BYTES | 5880 | #ifdef GC_CHECK_STRING_BYTES |
| 5881 | /* Check that the string size recorded in the string is the | 5881 | /* Check that the string size recorded in the string is the |
| 5882 | same as the one recorded in the sdata structure. */ | 5882 | same as the one recorded in the sdata structure. */ |
| 5883 | CHECK_STRING_BYTES (ptr); | 5883 | CHECK_STRING_BYTES (ptr); |
| 5884 | #endif /* GC_CHECK_STRING_BYTES */ | 5884 | #endif /* GC_CHECK_STRING_BYTES */ |
| 5885 | } | 5885 | } |
| @@ -6034,7 +6034,7 @@ mark_object (Lisp_Object arg) | |||
| 6034 | ptr = ptr->next; | 6034 | ptr = ptr->next; |
| 6035 | if (ptr) | 6035 | if (ptr) |
| 6036 | { | 6036 | { |
| 6037 | ptrx = ptr; /* Use of ptrx avoids compiler bug on Sun */ | 6037 | ptrx = ptr; /* Use of ptrx avoids compiler bug on Sun. */ |
| 6038 | XSETSYMBOL (obj, ptrx); | 6038 | XSETSYMBOL (obj, ptrx); |
| 6039 | goto loop; | 6039 | goto loop; |
| 6040 | } | 6040 | } |
| @@ -6044,34 +6044,42 @@ mark_object (Lisp_Object arg) | |||
| 6044 | case Lisp_Misc: | 6044 | case Lisp_Misc: |
| 6045 | CHECK_ALLOCATED_AND_LIVE (live_misc_p); | 6045 | CHECK_ALLOCATED_AND_LIVE (live_misc_p); |
| 6046 | 6046 | ||
| 6047 | if (XMISCTYPE (obj) == Lisp_Misc_Overlay) | 6047 | if (XMISCANY (obj)->gcmarkbit) |
| 6048 | mark_overlay (XOVERLAY (obj)); | 6048 | break; |
| 6049 | else | 6049 | |
| 6050 | switch (XMISCTYPE (obj)) | ||
| 6050 | { | 6051 | { |
| 6051 | if (XMISCANY (obj)->gcmarkbit) | 6052 | case Lisp_Misc_Marker: |
| 6052 | break; | 6053 | /* DO NOT mark thru the marker's chain. |
| 6054 | The buffer's markers chain does not preserve markers from gc; | ||
| 6055 | instead, markers are removed from the chain when freed by gc. */ | ||
| 6053 | XMISCANY (obj)->gcmarkbit = 1; | 6056 | XMISCANY (obj)->gcmarkbit = 1; |
| 6057 | break; | ||
| 6054 | 6058 | ||
| 6055 | /* Note that we don't mark thru the marker's | 6059 | case Lisp_Misc_Save_Value: |
| 6056 | chain. The buffer's markers chain does not | 6060 | XMISCANY (obj)->gcmarkbit = 1; |
| 6057 | preserve markers from GC; instead, markers | ||
| 6058 | are removed from the chain when freed by GC. */ | ||
| 6059 | |||
| 6060 | #if GC_MARK_STACK | 6061 | #if GC_MARK_STACK |
| 6061 | if (XMISCTYPE (obj) == Lisp_Misc_Save_Value) | 6062 | { |
| 6062 | { | 6063 | register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj); |
| 6063 | register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj); | 6064 | /* If DOGC is set, POINTER is the address of a memory |
| 6064 | /* If DOGC is set, POINTER is the address of a memory | 6065 | area containing INTEGER potential Lisp_Objects. */ |
| 6065 | area containing INTEGER potential Lisp_Objects. */ | 6066 | if (ptr->dogc) |
| 6066 | if (ptr->dogc) | 6067 | { |
| 6067 | { | 6068 | Lisp_Object *p = (Lisp_Object *) ptr->pointer; |
| 6068 | Lisp_Object *p = (Lisp_Object *) ptr->pointer; | 6069 | ptrdiff_t nelt; |
| 6069 | ptrdiff_t nelt; | 6070 | for (nelt = ptr->integer; nelt > 0; nelt--, p++) |
| 6070 | for (nelt = ptr->integer; nelt > 0; nelt--, p++) | 6071 | mark_maybe_object (*p); |
| 6071 | mark_maybe_object (*p); | 6072 | } |
| 6072 | } | 6073 | } |
| 6073 | } | ||
| 6074 | #endif | 6074 | #endif |
| 6075 | break; | ||
| 6076 | |||
| 6077 | case Lisp_Misc_Overlay: | ||
| 6078 | mark_overlay (XOVERLAY (obj)); | ||
| 6079 | break; | ||
| 6080 | |||
| 6081 | default: | ||
| 6082 | abort (); | ||
| 6075 | } | 6083 | } |
| 6076 | break; | 6084 | break; |
| 6077 | 6085 | ||