summaryrefslogtreecommitdiff
path: root/src/lisp.h
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2007-10-02 21:24:47 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2007-10-02 21:24:47 +0000
commit878f97ffedc5b4fc785beac809c3d4392f531eca (patch)
tree862d3533e412791972f9fd44fa4072d8173ff357 /src/lisp.h
parent5b2f56dfa64ff88188ece5093589a52542163e46 (diff)
downloademacs-878f97ffedc5b4fc785beac809c3d4392f531eca.tar.gz
* lisp.h (struct Lisp_Hash_Table): Move non-traced elements at the end.
Turn `count' into an integer. * fns.c (make_hash_table, hash_put, hash_remove, hash_clear) (sweep_weak_table, sweep_weak_hash_tables, Fhash_table_count): * print.c (print_object) <HASH_TABLE_P>: `count' is an int. * alloc.c (allocate_hash_table): Use ALLOCATE_PSEUDOVECTOR. (mark_object) <HASH_TABLE_P>: Use mark_vectorlike.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 5917e918b31..6dd24813f0e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1019,13 +1019,6 @@ struct Lisp_Hash_Table
ratio, a float. */
Lisp_Object rehash_threshold;
- /* Number of key/value entries in the table. */
- Lisp_Object count;
-
- /* Vector of keys and values. The key of item I is found at index
- 2 * I, the value is found at index 2 * I + 1. */
- Lisp_Object key_and_value;
-
/* Vector of hash codes.. If hash[I] is nil, this means that that
entry I is unused. */
Lisp_Object hash;
@@ -1049,6 +1042,18 @@ struct Lisp_Hash_Table
/* User-supplied key comparison function, or nil. */
Lisp_Object user_cmp_function;
+ /* Only the fields above are traced normally by the GC. The ones below
+ `count'. are special and are either ignored by the GC or traced in
+ a special way (e.g. because of weakness). */
+
+ /* Number of key/value entries in the table. */
+ unsigned int count;
+
+ /* Vector of keys and values. The key of item I is found at index
+ 2 * I, the value is found at index 2 * I + 1.
+ This is gc_marked specially if the table is weak. */
+ Lisp_Object key_and_value;
+
/* Next weak hash table if this is a weak hash table. The head
of the list is in weak_hash_tables. */
struct Lisp_Hash_Table *next_weak;