comparison src/mc-alloc.c @ 2932:6c70efc2b5b1

[xemacs-hg @ 2005-09-14 14:24:28 by crestani] Initialize lookup table.
author crestani
date Wed, 14 Sep 2005 14:24:30 +0000
parents 05d62157e048
children ec5f23ea6d2e
comparison
equal deleted inserted replaced
2931:0d5322818981 2932:6c70efc2b5b1
519 xmalloc_and_zero (sizeof (level_2_lookup_tree)); 519 xmalloc_and_zero (sizeof (level_2_lookup_tree));
520 #ifdef MEMORY_USAGE_STATS 520 #ifdef MEMORY_USAGE_STATS
521 MC_MALLOCED_BYTES += 521 MC_MALLOCED_BYTES +=
522 malloced_storage_size (0, sizeof (level_2_lookup_tree), 0); 522 malloced_storage_size (0, sizeof (level_2_lookup_tree), 0);
523 #endif 523 #endif
524 memset (l2, 0, sizeof (level_2_lookup_tree)); 524 memset (l2, '\0', sizeof (level_2_lookup_tree));
525 #ifdef USE_HASH_TABLE 525 #ifdef USE_HASH_TABLE
526 LEVEL2_HASH_LINK (l2) = PTR_LOOKUP_TABLE (l1_index); 526 LEVEL2_HASH_LINK (l2) = PTR_LOOKUP_TABLE (l1_index);
527 #endif 527 #endif
528 PTR_LOOKUP_TABLE (l1_index) = l2; 528 PTR_LOOKUP_TABLE (l1_index) = l2;
529 LEVEL2_KEY (l2) = l1_index; 529 LEVEL2_KEY (l2) = l1_index;
1688 void 1688 void
1689 init_mc_allocator (void) 1689 init_mc_allocator (void)
1690 { 1690 {
1691 int i; 1691 int i;
1692 1692
1693 memset (&mc_allocator_globals, '\0', sizeof (mc_allocator_globals_type));
1694
1693 for (i = 0; i < N_USED_PAGE_LISTS; i++) 1695 for (i = 0; i < N_USED_PAGE_LISTS; i++)
1694 { 1696 {
1695 page_list_header *plh = USED_HEAP_PAGES (i); 1697 page_list_header *plh = USED_HEAP_PAGES (i);
1696 PLH_LIST_TYPE (plh) = USED_LIST; 1698 PLH_LIST_TYPE (plh) = USED_LIST;
1697 PLH_SIZE (plh) = get_used_list_size_value (i); 1699 PLH_SIZE (plh) = get_used_list_size_value (i);