Mercurial > hg > xemacs-beta
comparison src/alloc.c @ 4735:80d74fed5399
Remove "old" GNU malloc in src/malloc.c, and all references to it. Drop the
GNU_MALLOC define, which was only used to distinguish between "old" and "new"
GNU malloc. See xemacs-patches message with ID
<870180fe0911061348g168f85e2m5153e2b554b94803@mail.gmail.com>.
author | Jerry James <james@xemacs.org> |
---|---|
date | Mon, 09 Nov 2009 09:21:59 -0700 |
parents | 80cd90837ac5 |
children | 73e8632018ad |
comparison
equal
deleted
inserted
replaced
4734:74a5eaa67982 | 4735:80d74fed5399 |
---|---|
4758 malloced_storage_size (void *UNUSED (ptr), Bytecount claimed_size, | 4758 malloced_storage_size (void *UNUSED (ptr), Bytecount claimed_size, |
4759 struct overhead_stats *stats) | 4759 struct overhead_stats *stats) |
4760 { | 4760 { |
4761 Bytecount orig_claimed_size = claimed_size; | 4761 Bytecount orig_claimed_size = claimed_size; |
4762 | 4762 |
4763 #ifdef GNU_MALLOC | 4763 #ifndef SYSTEM_MALLOC |
4764 if (claimed_size < (Bytecount) (2 * sizeof (void *))) | 4764 if (claimed_size < (Bytecount) (2 * sizeof (void *))) |
4765 claimed_size = 2 * sizeof (void *); | 4765 claimed_size = 2 * sizeof (void *); |
4766 # ifdef SUNOS_LOCALTIME_BUG | 4766 # ifdef SUNOS_LOCALTIME_BUG |
4767 if (claimed_size < 16) | 4767 if (claimed_size < 16) |
4768 claimed_size = 16; | 4768 claimed_size = 16; |
4795 claimed_size += 4095; | 4795 claimed_size += 4095; |
4796 claimed_size &= ~4095; | 4796 claimed_size &= ~4095; |
4797 claimed_size += (claimed_size / 4096) * 3 * sizeof (size_t); | 4797 claimed_size += (claimed_size / 4096) * 3 * sizeof (size_t); |
4798 } | 4798 } |
4799 | 4799 |
4800 #elif defined (SYSTEM_MALLOC) | 4800 #else |
4801 | 4801 |
4802 if (claimed_size < 16) | 4802 if (claimed_size < 16) |
4803 claimed_size = 16; | 4803 claimed_size = 16; |
4804 claimed_size += 2 * sizeof (void *); | 4804 claimed_size += 2 * sizeof (void *); |
4805 | 4805 |
4806 #else /* old GNU allocator */ | 4806 #endif /* system allocator */ |
4807 | |
4808 # ifdef rcheck /* #### may not be defined here */ | |
4809 claimed_size += 20; | |
4810 # else | |
4811 claimed_size += 8; | |
4812 # endif | |
4813 { | |
4814 /* fxg: rename log->log2 to supress gcc3 shadow warning */ | |
4815 int log2 = 1; | |
4816 | |
4817 /* compute the log base two, more or less, then use it to compute | |
4818 the block size needed. */ | |
4819 claimed_size--; | |
4820 /* It's big, it's heavy, it's wood! */ | |
4821 while ((claimed_size /= 2) != 0) | |
4822 ++log2; | |
4823 claimed_size = 1; | |
4824 /* It's better than bad, it's good! */ | |
4825 while (log2 > 0) | |
4826 { | |
4827 claimed_size *= 2; | |
4828 log2--; | |
4829 } | |
4830 } | |
4831 | |
4832 #endif /* old GNU allocator */ | |
4833 | 4807 |
4834 if (stats) | 4808 if (stats) |
4835 { | 4809 { |
4836 stats->was_requested += orig_claimed_size; | 4810 stats->was_requested += orig_claimed_size; |
4837 stats->malloc_overhead += claimed_size - orig_claimed_size; | 4811 stats->malloc_overhead += claimed_size - orig_claimed_size; |