2 ===================================================================
3 RCS file: /cvs/glibc/libc/malloc/Makefile,v
4 retrieving revision 1.54
5 retrieving revision 1.55
7 --- glibc/malloc/Makefile 7 May 2007 15:30:57 -0000 1.54
8 +++ glibc/malloc/Makefile 21 May 2007 16:12:25 -0000 1.55
12 CFLAGS-mcheck-init.c = $(PIC-ccflag)
13 -CFLAGS-malloc.c += -DMALLOC_DEBUG
15 $(objpfx)libmcheck.a: $(objpfx)mcheck-init.o
18 ===================================================================
19 RCS file: /cvs/glibc/libc/malloc/arena.c,v
20 retrieving revision 1.27
21 retrieving revision 1.28
23 --- glibc/malloc/arena.c 13 May 2007 20:32:57 -0000 1.27
24 +++ glibc/malloc/arena.c 21 May 2007 16:13:07 -0000 1.28
26 mp_.top_pad = DEFAULT_TOP_PAD;
28 mp_.n_mmaps_max = DEFAULT_MMAP_MAX;
30 - mp_.n_mmaps_cmax = DEFAULT_MMAP_MAX;
32 mp_.mmap_threshold = DEFAULT_MMAP_THRESHOLD;
33 mp_.trim_threshold = DEFAULT_TRIM_THRESHOLD;
34 mp_.pagesize = malloc_getpagesize;
36 ===================================================================
37 RCS file: /cvs/glibc/libc/malloc/hooks.c,v
38 retrieving revision 1.21
39 retrieving revision 1.22
41 --- glibc/malloc/hooks.c 13 May 2007 20:32:57 -0000 1.21
42 +++ glibc/malloc/hooks.c 21 May 2007 16:12:12 -0000 1.22
44 then the hooks are reset to 0. */
46 #define MALLOC_STATE_MAGIC 0x444c4541l
47 -#define MALLOC_STATE_VERSION (0*0x100l + 2l) /* major*0x100 + minor */
48 +#define MALLOC_STATE_VERSION (0*0x100l + 3l) /* major*0x100 + minor */
50 struct malloc_save_state {
53 unsigned long trim_threshold;
54 unsigned long top_pad;
55 unsigned int n_mmaps_max;
57 - unsigned int n_mmaps_cmax;
59 unsigned long mmap_threshold;
61 unsigned long max_sbrked_mem;
63 ms->trim_threshold = mp_.trim_threshold;
64 ms->top_pad = mp_.top_pad;
65 ms->n_mmaps_max = mp_.n_mmaps_max;
67 - ms->n_mmaps_cmax = mp_.n_mmaps_cmax;
69 ms->mmap_threshold = mp_.mmap_threshold;
70 ms->check_action = check_action;
71 ms->max_sbrked_mem = main_arena.max_system_mem;
73 assert(ms->av[2*i+3] == 0);
74 first(b) = last(b) = b;
76 - if(i<NSMALLBINS || (largebin_index(chunksize(ms->av[2*i+2]))==i &&
77 - largebin_index(chunksize(ms->av[2*i+3]))==i)) {
78 + if(ms->version >= 3 &&
79 + (i<NSMALLBINS || (largebin_index(chunksize(ms->av[2*i+2]))==i &&
80 + largebin_index(chunksize(ms->av[2*i+3]))==i))) {
81 first(b) = ms->av[2*i+2];
82 last(b) = ms->av[2*i+3];
83 /* Make sure the links to the bins within the heap are correct. */
88 + if (ms->version < 3) {
89 + /* Clear fd_nextsize and bk_nextsize fields. */
90 + b = unsorted_chunks(&main_arena)->fd;
91 + while (b != unsorted_chunks(&main_arena)) {
92 + if (!in_smallbin_range(chunksize(b))) {
93 + b->fd_nextsize = NULL;
94 + b->bk_nextsize = NULL;
99 mp_.sbrk_base = ms->sbrk_base;
100 main_arena.system_mem = ms->sbrked_mem_bytes;
101 mp_.trim_threshold = ms->trim_threshold;
102 mp_.top_pad = ms->top_pad;
103 mp_.n_mmaps_max = ms->n_mmaps_max;
105 - mp_.n_mmaps_cmax = ms->n_mmaps_cmax;
107 mp_.mmap_threshold = ms->mmap_threshold;
108 check_action = ms->check_action;
109 main_arena.max_system_mem = ms->max_sbrked_mem;
111 ===================================================================
112 RCS file: /cvs/glibc/libc/malloc/malloc.c,v
113 retrieving revision 1.178
114 retrieving revision 1.180
115 diff -u -r1.178 -r1.180
116 --- glibc/malloc/malloc.c 15 May 2007 01:51:17 -0000 1.178
117 +++ glibc/malloc/malloc.c 21 May 2007 16:12:53 -0000 1.180
118 @@ -2358,9 +2358,6 @@
119 /* Memory map support */
126 /* the mmap_threshold is dynamic, until the user sets
127 it manually, at which point we need to disable any
128 @@ -2572,7 +2569,7 @@
130 /* address is outside main heap */
131 if (contiguous(av) && av->top != initial_top(av)) {
132 - assert(((char*)p) < min_address || ((char*)p) > max_address);
133 + assert(((char*)p) < min_address || ((char*)p) >= max_address);
135 /* chunk is page-aligned */
136 assert(((p->prev_size + sz) & (mp_.pagesize-1)) == 0);
137 @@ -2876,8 +2873,6 @@
138 assert(total <= (unsigned long)(mp_.max_total_mem));
139 assert(mp_.n_mmaps >= 0);
141 - assert(mp_.n_mmaps <= mp_.n_mmaps_cmax);
142 - assert(mp_.n_mmaps_max <= mp_.n_mmaps_cmax);
143 assert(mp_.n_mmaps <= mp_.max_n_mmaps);
145 assert((unsigned long)(av->system_mem) <=
146 @@ -3475,13 +3470,6 @@
151 - if (mp_.n_mmaps_cmax > mp_.n_mmaps_max)
153 - assert (mp_.n_mmaps_cmax == mp_.n_mmaps + 1);
154 - mp_.n_mmaps_cmax = mp_.n_mmaps;
157 mp_.mmapped_mem -= total_size;
159 int ret __attribute__ ((unused)) = munmap((char *)block, total_size);
160 @@ -5397,9 +5385,6 @@
162 mem = _int_malloc(av, size);
163 mp_.n_mmaps_max = mmx; /* reset mmap */
165 - mp_.n_mmaps_cmax = mmx;
170 @@ -5725,17 +5710,8 @@
176 - if (mp_.n_mmaps <= value)
177 - mp_.n_mmaps_cmax = value;
179 - mp_.n_mmaps_cmax = mp_.n_mmaps;
182 - mp_.n_mmaps_max = value;
183 - mp_.no_dyn_threshold = 1;
185 + mp_.n_mmaps_max = value;
186 + mp_.no_dyn_threshold = 1;
191 ===================================================================
192 RCS file: /cvs/glibc/libc/malloc/mcheck.c,v
193 retrieving revision 1.18
194 retrieving revision 1.20
195 diff -u -r1.18 -r1.20
196 --- glibc/malloc/mcheck.c 8 Sep 2004 20:36:02 -0000 1.18
197 +++ glibc/malloc/mcheck.c 19 May 2007 04:27:20 -0000 1.20
199 /* Standard debugging hooks for `malloc'.
200 - Copyright (C) 1990-1997,99,2000,01,02 Free Software Foundation, Inc.
201 + Copyright (C) 1990-1997,1999,2000-2002,2007 Free Software Foundation, Inc.
202 This file is part of the GNU C Library.
203 Written May 1989 by Mike Haertel.
207 reallochook (__ptr_t ptr, __malloc_size_t size, const __ptr_t caller)
211 + freehook (ptr, caller);
216 __malloc_size_t osize;