diff options
| author | Paul Eggert | 2017-01-31 08:29:02 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-01-31 08:31:14 -0800 |
| commit | a727a0303eb34858389cb4331944e0e63411f2ff (patch) | |
| tree | cc19d451a63284078593cb49056078e65b4a8678 /src/alloc.c | |
| parent | 52a1ce65d693daaa395e7d594ec441ab7b652d70 (diff) | |
| download | emacs-a727a0303eb34858389cb4331944e0e63411f2ff.tar.gz emacs-a727a0303eb34858389cb4331944e0e63411f2ff.zip | |
* src/alloc.c, src/lisp.h: Fix minor glitches in recent changes.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/alloc.c b/src/alloc.c index dd2b688f91e..b59220c5d84 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -5437,7 +5437,8 @@ make_pure_vector (ptrdiff_t len) | |||
| 5437 | /* Copy all contents and parameters of TABLE to a new table allocated | 5437 | /* Copy all contents and parameters of TABLE to a new table allocated |
| 5438 | from pure space, return the purified table. */ | 5438 | from pure space, return the purified table. */ |
| 5439 | static struct Lisp_Hash_Table * | 5439 | static struct Lisp_Hash_Table * |
| 5440 | purecopy_hash_table (struct Lisp_Hash_Table *table) { | 5440 | purecopy_hash_table (struct Lisp_Hash_Table *table) |
| 5441 | { | ||
| 5441 | eassert (NILP (table->weak)); | 5442 | eassert (NILP (table->weak)); |
| 5442 | eassert (!NILP (table->pure)); | 5443 | eassert (!NILP (table->pure)); |
| 5443 | 5444 | ||
| @@ -5480,14 +5481,12 @@ Does not copy symbols. Copies strings without text properties. */) | |||
| 5480 | return purecopy (obj); | 5481 | return purecopy (obj); |
| 5481 | } | 5482 | } |
| 5482 | 5483 | ||
| 5483 | struct pinned_object | 5484 | /* Pinned objects are marked before every GC cycle. */ |
| 5485 | static struct pinned_object | ||
| 5484 | { | 5486 | { |
| 5485 | Lisp_Object object; | 5487 | Lisp_Object object; |
| 5486 | struct pinned_object *next; | 5488 | struct pinned_object *next; |
| 5487 | }; | 5489 | } *pinned_objects; |
| 5488 | |||
| 5489 | /* Pinned objects are marked before every GC cycle. */ | ||
| 5490 | static struct pinned_object *pinned_objects; | ||
| 5491 | 5490 | ||
| 5492 | static Lisp_Object | 5491 | static Lisp_Object |
| 5493 | purecopy (Lisp_Object obj) | 5492 | purecopy (Lisp_Object obj) |
| @@ -5519,13 +5518,13 @@ purecopy (Lisp_Object obj) | |||
| 5519 | else if (HASH_TABLE_P (obj)) | 5518 | else if (HASH_TABLE_P (obj)) |
| 5520 | { | 5519 | { |
| 5521 | struct Lisp_Hash_Table *table = XHASH_TABLE (obj); | 5520 | struct Lisp_Hash_Table *table = XHASH_TABLE (obj); |
| 5522 | /* We cannot purify hash tables which haven't been defined with | 5521 | /* Do not purify hash tables which haven't been defined with |
| 5523 | :purecopy as non-nil or are weak - they aren't guaranteed to | 5522 | :purecopy as non-nil or are weak - they aren't guaranteed to |
| 5524 | not change. */ | 5523 | not change. */ |
| 5525 | if (!NILP (table->weak) || NILP (table->pure)) | 5524 | if (!NILP (table->weak) || NILP (table->pure)) |
| 5526 | { | 5525 | { |
| 5527 | /* Instead, the hash table is added to the list of pinned objects, | 5526 | /* Instead, add the hash table to the list of pinned objects, |
| 5528 | and is marked before GC. */ | 5527 | so that it will be marked during GC. */ |
| 5529 | struct pinned_object *o = xmalloc (sizeof *o); | 5528 | struct pinned_object *o = xmalloc (sizeof *o); |
| 5530 | o->object = obj; | 5529 | o->object = obj; |
| 5531 | o->next = pinned_objects; | 5530 | o->next = pinned_objects; |
| @@ -5755,11 +5754,8 @@ compact_undo_list (Lisp_Object list) | |||
| 5755 | static void | 5754 | static void |
| 5756 | mark_pinned_objects (void) | 5755 | mark_pinned_objects (void) |
| 5757 | { | 5756 | { |
| 5758 | struct pinned_object *pobj; | 5757 | for (struct pinned_object *pobj = pinned_objects; pobj; pobj = pobj->next) |
| 5759 | for (pobj = pinned_objects; pobj; pobj = pobj->next) | 5758 | mark_object (pobj->object); |
| 5760 | { | ||
| 5761 | mark_object (pobj->object); | ||
| 5762 | } | ||
| 5763 | } | 5759 | } |
| 5764 | 5760 | ||
| 5765 | static void | 5761 | static void |