diff options
| author | Paul Eggert | 2018-08-09 00:35:47 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-08-11 18:50:25 -0700 |
| commit | 6c12f4e63f60eb280c5fc08dc76f11d097184dc7 (patch) | |
| tree | 56ddc05ba736ca648844902f8532fac42aa50bfe /src | |
| parent | d614e4a8cd2d5fe37b38bb4d8191013a7d917731 (diff) | |
| download | emacs-6c12f4e63f60eb280c5fc08dc76f11d097184dc7.tar.gz emacs-6c12f4e63f60eb280c5fc08dc76f11d097184dc7.zip | |
Simplify mark_object for pseudovectors
Suggested by Pip Cet (Bug#32405#14).
* src/alloc.c (mark_object): Remove unnecessary special cases for
PVEC_MARKER, PVEC_BOOL_VECTOR, PVEC_MISC_PTR, PVEC_USER_PTR, and
PVEC_FINALIZER.
change is to free up an enum Lisp_Type tag value, a scarce
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 20 | ||||
| -rw-r--r-- | src/lisp.h | 4 |
2 files changed, 5 insertions, 19 deletions
diff --git a/src/alloc.c b/src/alloc.c index fea0cec383b..337668f9c31 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -6495,28 +6495,10 @@ mark_object (Lisp_Object arg) | |||
| 6495 | mark_char_table (ptr, (enum pvec_type) pvectype); | 6495 | mark_char_table (ptr, (enum pvec_type) pvectype); |
| 6496 | break; | 6496 | break; |
| 6497 | 6497 | ||
| 6498 | case PVEC_MARKER: | ||
| 6499 | /* DO NOT mark thru the marker's chain. | ||
| 6500 | The buffer's markers chain does not preserve markers from gc; | ||
| 6501 | instead, markers are removed from the chain when freed by gc. */ | ||
| 6502 | case PVEC_BOOL_VECTOR: | ||
| 6503 | case PVEC_MISC_PTR: | ||
| 6504 | #ifdef HAVE_MODULES | ||
| 6505 | case PVEC_USER_PTR: | ||
| 6506 | #endif | ||
| 6507 | /* No Lisp_Objects to mark in these. */ | ||
| 6508 | VECTOR_MARK (ptr); | ||
| 6509 | break; | ||
| 6510 | |||
| 6511 | case PVEC_OVERLAY: | 6498 | case PVEC_OVERLAY: |
| 6512 | mark_overlay (XOVERLAY (obj)); | 6499 | mark_overlay (XOVERLAY (obj)); |
| 6513 | break; | 6500 | break; |
| 6514 | 6501 | ||
| 6515 | case PVEC_FINALIZER: | ||
| 6516 | VECTOR_MARK (ptr); | ||
| 6517 | mark_object (XFINALIZER (obj)->function); | ||
| 6518 | break; | ||
| 6519 | |||
| 6520 | case PVEC_SUBR: | 6502 | case PVEC_SUBR: |
| 6521 | break; | 6503 | break; |
| 6522 | 6504 | ||
| @@ -6524,6 +6506,8 @@ mark_object (Lisp_Object arg) | |||
| 6524 | emacs_abort (); | 6506 | emacs_abort (); |
| 6525 | 6507 | ||
| 6526 | default: | 6508 | default: |
| 6509 | /* A regular vector, or a pseudovector needing no special | ||
| 6510 | treatment. */ | ||
| 6527 | mark_vectorlike (ptr); | 6511 | mark_vectorlike (ptr); |
| 6528 | } | 6512 | } |
| 6529 | } | 6513 | } |
diff --git a/src/lisp.h b/src/lisp.h index c080cc6b146..dcc157e0b96 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2264,7 +2264,9 @@ struct Lisp_Marker | |||
| 2264 | does not point anywhere. */ | 2264 | does not point anywhere. */ |
| 2265 | 2265 | ||
| 2266 | /* For markers that point somewhere, | 2266 | /* For markers that point somewhere, |
| 2267 | this is used to chain of all the markers in a given buffer. */ | 2267 | this is used to chain of all the markers in a given buffer. |
| 2268 | The chain does not preserve markers from garbage collection; | ||
| 2269 | instead, markers are removed from the chain when freed by GC. */ | ||
| 2268 | /* We could remove it and use an array in buffer_text instead. | 2270 | /* We could remove it and use an array in buffer_text instead. |
| 2269 | That would also allow us to preserve it ordered. */ | 2271 | That would also allow us to preserve it ordered. */ |
| 2270 | struct Lisp_Marker *next; | 2272 | struct Lisp_Marker *next; |