* malloc.cc: Update to 2.7.2.
* malloc_wrapper.cc (malloc_init): Call user level mallocs to determine if the malloc has been wrapped.
This commit is contained in:
parent
aaac1d9e19
commit
a80add95d9
winsup/cygwin
|
@ -1,3 +1,9 @@
|
||||||
|
2002-08-17 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* malloc.cc: Update to 2.7.2.
|
||||||
|
* malloc_wrapper.cc (malloc_init): Call user level mallocs to determine
|
||||||
|
if the malloc has been wrapped.
|
||||||
|
|
||||||
2002-08-16 Christopher Faylor <cgf@redhat.com>
|
2002-08-16 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* winsup.h: Remove malloc_*lock functions.
|
* winsup.h: Remove malloc_*lock functions.
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
way you wish. Send questions, comments, complaints, performance
|
way you wish. Send questions, comments, complaints, performance
|
||||||
data, etc to dl@cs.oswego.edu
|
data, etc to dl@cs.oswego.edu
|
||||||
|
|
||||||
* VERSION 2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee)
|
* VERSION 2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee)
|
||||||
|
|
||||||
Note: There may be an updated version of this malloc obtainable at
|
Note: There may be an updated version of this malloc obtainable at
|
||||||
ftp://gee.cs.oswego.edu/pub/misc/malloc.c
|
ftp://gee.cs.oswego.edu/pub/misc/malloc.c
|
||||||
|
@ -1567,8 +1567,8 @@ static pthread_mutex_t mALLOC_MUTEx = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
/* Substitute anything you like for these */
|
/* Substitute anything you like for these */
|
||||||
|
|
||||||
#define MALLOC_PREACTION __malloc_lock ()
|
#define MALLOC_PREACTION (0)
|
||||||
#define MALLOC_POSTACTION __malloc_unlock ()
|
#define MALLOC_POSTACTION (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2412,8 +2412,8 @@ struct malloc_state {
|
||||||
/* Normal bins packed as described above */
|
/* Normal bins packed as described above */
|
||||||
mchunkptr bins[NBINS * 2];
|
mchunkptr bins[NBINS * 2];
|
||||||
|
|
||||||
/* Bitmap of bins */
|
/* Bitmap of bins. Trailing zero map handles cases of largest binned size */
|
||||||
unsigned int binmap[BINMAPSIZE];
|
unsigned int binmap[BINMAPSIZE+1];
|
||||||
|
|
||||||
/* Tunable parameters */
|
/* Tunable parameters */
|
||||||
CHUNK_SIZE_T trim_threshold;
|
CHUNK_SIZE_T trim_threshold;
|
||||||
|
@ -5433,6 +5433,9 @@ static int cpuinfo (int whole, CHUNK_SIZE_T *kernel, CHUNK_SIZE_T *user) {
|
||||||
|
|
||||||
/* ------------------------------------------------------------
|
/* ------------------------------------------------------------
|
||||||
History:
|
History:
|
||||||
|
V2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee)
|
||||||
|
* Fix malloc_state bitmap array misdeclaration
|
||||||
|
|
||||||
V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee)
|
V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee)
|
||||||
* Allow tuning of FIRST_SORTED_BIN_SIZE
|
* Allow tuning of FIRST_SORTED_BIN_SIZE
|
||||||
* Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.
|
* Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.
|
||||||
|
|
|
@ -111,7 +111,7 @@ strdup (const char *s)
|
||||||
extern "C" void
|
extern "C" void
|
||||||
free (void *p)
|
free (void *p)
|
||||||
{
|
{
|
||||||
malloc_printf ("(%p), called by %x", p, ((int *)&p)[-1]);
|
malloc_printf ("(%p), called by %p", p, __builtin_return_address (0));
|
||||||
if (!use_internal_malloc)
|
if (!use_internal_malloc)
|
||||||
user_data->free (p);
|
user_data->free (p);
|
||||||
else
|
else
|
||||||
|
@ -135,7 +135,7 @@ malloc (size_t size)
|
||||||
res = dlmalloc (size);
|
res = dlmalloc (size);
|
||||||
__malloc_unlock ();
|
__malloc_unlock ();
|
||||||
}
|
}
|
||||||
malloc_printf ("(%d) = %x, called by %x", size, res, ((int *)&size)[-1]);
|
malloc_printf ("(%d) = %x, called by %p", size, res, __builtin_return_address (0));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ realloc (void *p, size_t size)
|
||||||
res = dlrealloc (p, size);
|
res = dlrealloc (p, size);
|
||||||
__malloc_unlock ();
|
__malloc_unlock ();
|
||||||
}
|
}
|
||||||
malloc_printf ("(%x, %d) = %x, called by %x", p, size, res, ((int *)&p)[-1]);
|
malloc_printf ("(%x, %d) = %x, called by %x", p, size, res, __builtin_return_address (0));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ calloc (size_t nmemb, size_t size)
|
||||||
res = dlcalloc (nmemb, size);
|
res = dlcalloc (nmemb, size);
|
||||||
__malloc_unlock ();
|
__malloc_unlock ();
|
||||||
}
|
}
|
||||||
malloc_printf ("(%d, %d) = %x, called by %x", nmemb, size, res, ((int *)&nmemb)[-1]);
|
malloc_printf ("(%d, %d) = %x, called by %x", nmemb, size, res, __builtin_return_address (0));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ malloc_init ()
|
||||||
#ifdef MALLOC_DEBUG
|
#ifdef MALLOC_DEBUG
|
||||||
_free_r (NULL, _malloc_r (NULL, 16));
|
_free_r (NULL, _malloc_r (NULL, 16));
|
||||||
#else
|
#else
|
||||||
free (malloc (16));
|
user_data->free (user_data->malloc (16));
|
||||||
#endif
|
#endif
|
||||||
if (!export_malloc_called)
|
if (!export_malloc_called)
|
||||||
use_internal_malloc = 0;
|
use_internal_malloc = 0;
|
||||||
|
|
Loading…
Reference in New Issue