diff options
| author | Paul Eggert | 2017-02-21 15:31:29 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-02-21 15:39:17 -0800 |
| commit | 5cbdaa98f975c870c4afa24346630a18b55f27ab (patch) | |
| tree | b0a776c467e6b1d53fd1e2837305fbc512803df7 /src/alloc.c | |
| parent | 7207b63c8e290ddec33908ce8d38be5793388318 (diff) | |
| download | emacs-5cbdaa98f975c870c4afa24346630a18b55f27ab.tar.gz emacs-5cbdaa98f975c870c4afa24346630a18b55f27ab.zip | |
Use ptrdiff_t instead of Lisp_Object for collision
* src/alloc.c (purecopy_hash_table): Assign, don’t purecopy.
* src/fns.c (set_hash_next_slot, set_hash_index_slot): Hash index
arg is now ptrdiff_t index (or -1 if empty), not Lisp_Object
integer (or Qnil if empty). All callers changed.
(larger_vecalloc): New static function.
(larger_vector): Use it.
(HASH_NEXT, HASH_INDEX): Move here from lisp.h. Return ptrdiff_t
index (or -1) not Lisp_Object integer (or Qnil). All callers changed.
* src/fns.c (make_hash_table, maybe_resize_hash_table, hash_lookup)
(hash_put, hash_remove_from_table, hash_clear, sweep_weak_table):
* src/profiler.c (evict_lower_half, record_backtrace):
-1, not nil, is now the convention for end of collision list.
* src/fns.c (maybe_resize_hash_table): Avoid double-initialization
of the free list. Reallocate H->next last, in case other
reallocations exhaust memory.
* src/lisp.h (struct Lisp_Hash_Table): ‘next_free’ is now
ptrdiff_t, not Lisp_Object. Adjust commentary for ‘next’ and
‘index’, which no longer contain nil.
(HASH_NEXT, HASH_INDEX): Move to src/fns.c.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c index b579e7ed1ae..5da4290701e 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -5459,7 +5459,7 @@ purecopy_hash_table (struct Lisp_Hash_Table *table) | |||
| 5459 | pure->rehash_size = purecopy (table->rehash_size); | 5459 | pure->rehash_size = purecopy (table->rehash_size); |
| 5460 | pure->hash = purecopy (table->hash); | 5460 | pure->hash = purecopy (table->hash); |
| 5461 | pure->next = purecopy (table->next); | 5461 | pure->next = purecopy (table->next); |
| 5462 | pure->next_free = purecopy (table->next_free); | 5462 | pure->next_free = table->next_free; |
| 5463 | pure->index = purecopy (table->index); | 5463 | pure->index = purecopy (table->index); |
| 5464 | pure->count = table->count; | 5464 | pure->count = table->count; |
| 5465 | pure->pure = table->pure; | 5465 | pure->pure = table->pure; |