Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-08-18 07:28:52 +0400
committerChristopher Faylor <me@cgf.cx>2002-08-18 07:28:52 +0400
commita80add95d9e1598ff55e32801d1719a79146be8c (patch)
tree345dd2360ed3d4d69bbdda2c9614b1ff80f7049e /winsup
parentaaac1d9e19b8d758b5cf92f3546f55ab91038f38 (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')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/malloc.cc13
-rw-r--r--winsup/cygwin/malloc_wrapper.cc10
3 files changed, 19 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 5b7a7e975..8f87dbc44 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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>
* winsup.h: Remove malloc_*lock functions.
diff --git a/winsup/cygwin/malloc.cc b/winsup/cygwin/malloc.cc
index 45005fdb8..440716529 100644
--- a/winsup/cygwin/malloc.cc
+++ b/winsup/cygwin/malloc.cc
@@ -5,7 +5,7 @@
way you wish. Send questions, comments, complaints, performance
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
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 */
-#define MALLOC_PREACTION __malloc_lock ()
-#define MALLOC_POSTACTION __malloc_unlock ()
+#define MALLOC_PREACTION (0)
+#define MALLOC_POSTACTION (0)
#endif
@@ -2412,8 +2412,8 @@ struct malloc_state {
/* Normal bins packed as described above */
mchunkptr bins[NBINS * 2];
- /* Bitmap of bins */
- unsigned int binmap[BINMAPSIZE];
+ /* Bitmap of bins. Trailing zero map handles cases of largest binned size */
+ unsigned int binmap[BINMAPSIZE+1];
/* Tunable parameters */
CHUNK_SIZE_T trim_threshold;
@@ -5433,6 +5433,9 @@ static int cpuinfo (int whole, CHUNK_SIZE_T *kernel, CHUNK_SIZE_T *user) {
/* ------------------------------------------------------------
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)
* Allow tuning of FIRST_SORTED_BIN_SIZE
* Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.
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;