comparison src/hash.c @ 267:966663fcf606 r20-5b32

Import from CVS: tag r20-5b32
author cvs
date Mon, 13 Aug 2007 10:26:29 +0200
parents f955c73f5258
children c5d627a313b1
comparison
equal deleted inserted replaced
266:18d185df8c54 267:966663fcf606
270 /* We test for Qzero to facilitate free-hook.c. That module creates 270 /* We test for Qzero to facilitate free-hook.c. That module creates
271 a hashtable very very early, at which point Qnil has not yet 271 a hashtable very very early, at which point Qnil has not yet
272 been set and is thus all zeroes. Qzero is "automatically" 272 been set and is thus all zeroes. Qzero is "automatically"
273 initialized at startup because its correct value is also all 273 initialized at startup because its correct value is also all
274 zeroes. */ 274 zeroes. */
275 if (!NILP (hash->elisp_table) && !ZEROP (hash->elisp_table)) 275 if (!EQ (hash->elisp_table, Qnull_pointer) &&
276 !NILP (hash->elisp_table) &&
277 !ZEROP (hash->elisp_table))
276 new_harray = (hentry *) elisp_hvector_malloc (sizeof (hentry) * new_hsize, 278 new_harray = (hentry *) elisp_hvector_malloc (sizeof (hentry) * new_hsize,
277 hash->elisp_table); 279 hash->elisp_table);
278 else 280 else
279 #endif 281 #endif
280 new_harray = (hentry *) xmalloc (sizeof (hentry) * new_hsize); 282 new_harray = (hentry *) xmalloc (sizeof (hentry) * new_hsize);
291 hash->zero_entry = old_zero_entry; 293 hash->zero_entry = old_zero_entry;
292 rehash (old_harray, hash, old_hsize); 294 rehash (old_harray, hash, old_hsize);
293 } 295 }
294 296
295 #ifdef emacs 297 #ifdef emacs
296 if (!NILP (hash->elisp_table) && !ZEROP (hash->elisp_table)) 298 if (!EQ (hash->elisp_table, Qnull_pointer) &&
299 !NILP (hash->elisp_table) &&
300 !ZEROP (hash->elisp_table))
297 elisp_hvector_free (old_harray, hash->elisp_table); 301 elisp_hvector_free (old_harray, hash->elisp_table);
298 else 302 else
299 #endif 303 #endif
300 xfree (old_harray); 304 xfree (old_harray);
301 } 305 }