comparison src/elhash.c @ 458:c33ae14dd6d0 r21-2-44

Import from CVS: tag r21-2-44
author cvs
date Mon, 13 Aug 2007 11:42:25 +0200
parents 3d3049ae1304
children 0784d089fdc9
comparison
equal deleted inserted replaced
457:4b9290a33024 458:c33ae14dd6d0
438 size_t size, 438 size_t size,
439 double rehash_size, 439 double rehash_size,
440 double rehash_threshold, 440 double rehash_threshold,
441 enum hash_table_weakness weakness) 441 enum hash_table_weakness weakness)
442 { 442 {
443 hash_table_hash_function_t hash_function = 0; 443 hash_table_hash_function_t hash_function = 0;
444 hash_table_test_function_t test_function = 0; 444 hash_table_test_function_t test_function = 0;
445 445
446 switch (test) 446 switch (test)
447 { 447 {
448 case HASH_TABLE_EQ: 448 case HASH_TABLE_EQ:
498 ht->count = 0; 498 ht->count = 0;
499 499
500 compute_hash_table_derived_values (ht); 500 compute_hash_table_derived_values (ht);
501 501
502 /* We leave room for one never-occupied sentinel hentry at the end. */ 502 /* We leave room for one never-occupied sentinel hentry at the end. */
503 ht->hentries = xnew_array (hentry, ht->size + 1); 503 ht->hentries = xnew_array_and_zero (hentry, ht->size + 1);
504
505 {
506 hentry *e, *sentinel;
507 for (e = ht->hentries, sentinel = e + ht->size; e <= sentinel; e++)
508 CLEAR_HENTRY (e);
509 }
510 504
511 XSETHASH_TABLE (hash_table, ht); 505 XSETHASH_TABLE (hash_table, ht);
512 506
513 if (weakness == HASH_TABLE_NON_WEAK) 507 if (weakness == HASH_TABLE_NON_WEAK)
514 ht->next_weak = Qunbound; 508 ht->next_weak = Qunbound;