Mercurial > hg > xemacs-beta
comparison src/elhash.c @ 3017:1e7cc382eb16
[xemacs-hg @ 2005-10-24 10:07:26 by ben]
refactor mc-alloc dependencies
next-error.el, occur.el: Fix some byte-compile warnings.
alloc.c, buffer.c, buffer.h, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, console-impl.h, console-msw-impl.h, console.c, data.c, database.c, device-impl.h, device-msw.c, device.c, dialog-msw.c, elhash.c, events.h, extents-impl.h, extents.c, faces.c, faces.h, file-coding.c, file-coding.h, frame-impl.h, frame.c, glyphs.c, glyphs.h, gui.c, gui.h, keymap.c, lisp.h, lrecord.h, lstream.c, lstream.h, mule-charset.c, objects-impl.h, objects.c, opaque.c, opaque.h, print.c, process.c, procimpl.h, rangetab.c, rangetab.h, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, specifier.c, specifier.h, symbols.c, symeval.h, toolbar.c, toolbar.h, tooltalk.c, ui-gtk.c, ui-gtk.h, unicode.c, window-impl.h, window.c:
Eliminate the majority of #ifdef MC_ALLOC occurrences through
macros LCRECORD_HEADER, ALLOC_LCRECORD_TYPE, MALLOCED_STORAGE_SIZE,
etc. (defined in lrecord.h).
author | ben |
---|---|
date | Mon, 24 Oct 2005 10:07:42 +0000 |
parents | 6fa9919a9a0b |
children | 141c2920ea48 3742ea8250b5 |
comparison
equal
deleted
inserted
replaced
3016:f252275fb013 | 3017:1e7cc382eb16 |
---|---|
100 Lisp_Object value; | 100 Lisp_Object value; |
101 } htentry; | 101 } htentry; |
102 | 102 |
103 struct Lisp_Hash_Table | 103 struct Lisp_Hash_Table |
104 { | 104 { |
105 #ifdef MC_ALLOC | 105 struct LCRECORD_HEADER header; |
106 struct lrecord_header header; | |
107 #else /* MC_ALLOC */ | |
108 struct lcrecord_header header; | |
109 #endif /* MC_ALLOC */ | |
110 Elemcount size; | 106 Elemcount size; |
111 Elemcount count; | 107 Elemcount count; |
112 Elemcount rehash_count; | 108 Elemcount rehash_count; |
113 double rehash_size; | 109 double rehash_size; |
114 double rehash_threshold; | 110 double rehash_threshold; |
552 double rehash_size, | 548 double rehash_size, |
553 double rehash_threshold, | 549 double rehash_threshold, |
554 enum hash_table_weakness weakness) | 550 enum hash_table_weakness weakness) |
555 { | 551 { |
556 Lisp_Object hash_table; | 552 Lisp_Object hash_table; |
557 #ifdef MC_ALLOC | 553 Lisp_Hash_Table *ht = ALLOC_LCRECORD_TYPE (Lisp_Hash_Table, &lrecord_hash_table); |
558 Lisp_Hash_Table *ht = alloc_lrecord_type (Lisp_Hash_Table, &lrecord_hash_table); | |
559 #else /* not MC_ALLOC */ | |
560 Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table); | |
561 #endif /* not MC_ALLOC */ | |
562 | 554 |
563 ht->test_function = test_function; | 555 ht->test_function = test_function; |
564 ht->hash_function = hash_function; | 556 ht->hash_function = hash_function; |
565 ht->weakness = weakness; | 557 ht->weakness = weakness; |
566 | 558 |
973 The keys and values will not themselves be copied. | 965 The keys and values will not themselves be copied. |
974 */ | 966 */ |
975 (hash_table)) | 967 (hash_table)) |
976 { | 968 { |
977 const Lisp_Hash_Table *ht_old = xhash_table (hash_table); | 969 const Lisp_Hash_Table *ht_old = xhash_table (hash_table); |
978 #ifdef MC_ALLOC | 970 Lisp_Hash_Table *ht = ALLOC_LCRECORD_TYPE (Lisp_Hash_Table, &lrecord_hash_table); |
979 Lisp_Hash_Table *ht = alloc_lrecord_type (Lisp_Hash_Table, &lrecord_hash_table); | 971 COPY_LCRECORD (ht, ht_old); |
980 | |
981 copy_lrecord (ht, ht_old); | |
982 #else /* not MC_ALLOC */ | |
983 Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table); | |
984 copy_lcrecord (ht, ht_old); | |
985 #endif /* not MC_ALLOC */ | |
986 | 972 |
987 ht->hentries = xnew_array (htentry, ht_old->size + 1); | 973 ht->hentries = xnew_array (htentry, ht_old->size + 1); |
988 memcpy (ht->hentries, ht_old->hentries, (ht_old->size + 1) * sizeof (htentry)); | 974 memcpy (ht->hentries, ht_old->hentries, (ht_old->size + 1) * sizeof (htentry)); |
989 | 975 |
990 hash_table = wrap_hash_table (ht); | 976 hash_table = wrap_hash_table (ht); |