diff src/lisp.h @ 85021:a0c901e4e649

* 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.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 02 Oct 2007 21:24:47 +0000
parents 3a31b2cfe77f
children 96eb42c9e0e3
line wrap: on
line diff
--- a/src/lisp.h	Tue Oct 02 21:19:17 2007 +0000
+++ b/src/lisp.h	Tue Oct 02 21:24:47 2007 +0000
@@ -1019,13 +1019,6 @@
      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 @@
   /* 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;