diff options
author | Christopher Faylor <me@cgf.cx> | 2002-08-18 07:28:52 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-08-18 07:28:52 +0400 |
commit | a80add95d9e1598ff55e32801d1719a79146be8c (patch) | |
tree | 345dd2360ed3d4d69bbdda2c9614b1ff80f7049e /winsup/cygwin/malloc_wrapper.cc | |
parent | aaac1d9e19b8d758b5cf92f3546f55ab91038f38 (diff) |
* malloc.cc: Update to 2.7.2.
* malloc_wrapper.cc (malloc_init): Call user level mallocs to determine if the
malloc has been wrapped.
Diffstat (limited to 'winsup/cygwin/malloc_wrapper.cc')
-rw-r--r-- | winsup/cygwin/malloc_wrapper.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/winsup/cygwin/malloc_wrapper.cc b/winsup/cygwin/malloc_wrapper.cc index 96c6d2d12..51cc81832 100644 --- a/winsup/cygwin/malloc_wrapper.cc +++ b/winsup/cygwin/malloc_wrapper.cc @@ -111,7 +111,7 @@ strdup (const char *s) extern "C" void 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) user_data->free (p); else @@ -135,7 +135,7 @@ malloc (size_t size) res = dlmalloc (size); __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; } @@ -151,7 +151,7 @@ realloc (void *p, size_t size) res = dlrealloc (p, size); __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; } @@ -167,7 +167,7 @@ calloc (size_t nmemb, size_t size) res = dlcalloc (nmemb, size); __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; } @@ -313,7 +313,7 @@ malloc_init () #ifdef MALLOC_DEBUG _free_r (NULL, _malloc_r (NULL, 16)); #else - free (malloc (16)); + user_data->free (user_data->malloc (16)); #endif if (!export_malloc_called) use_internal_malloc = 0; |