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
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-02-23 02:02:15 +0300
committerChristopher Faylor <me@cgf.cx>2003-02-23 02:02:15 +0300
commita066f3645b3916e8fdd2fdbcc7eed6ca6bcfe989 (patch)
tree7253fb0d46070686ca5fc90ca28b269e70607b9b
parent878e60c56146c6e8fe6530de84627bf4c3a9d20e (diff)
* cygmalloc.h: Remove MORECORE_CANNOT_TRIM. It's not true. # cygwin.din:
Export mallinfo. # malloc_wrapper.cc (mallinfo): New function.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/cygmalloc.h1
-rw-r--r--winsup/cygwin/cygwin.din1
-rw-r--r--winsup/cygwin/malloc_wrapper.cc18
4 files changed, 25 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 97e1bbcd3..6c313cde7 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2003-02-22 Christopher Faylor <cgf@redhat.com>
+
+ * cygmalloc.h: Remove MORECORE_CANNOT_TRIM. It's not true.
+ # cygwin.din: Export mallinfo.
+ # malloc_wrapper.cc (mallinfo): New function.
+
2003-02-22 Pierre Humblet <pierre.humblet@ieee.org>
* syslog.cc (syslog): Do not print the Windows pid. Print the Cygwin
diff --git a/winsup/cygwin/cygmalloc.h b/winsup/cygwin/cygmalloc.h
index 2c1bbde42..3d3a0acd5 100644
--- a/winsup/cygwin/cygmalloc.h
+++ b/winsup/cygwin/cygmalloc.h
@@ -21,7 +21,6 @@ extern "C" void dlmalloc_stats ();
#ifndef __INSIDE_CYGWIN__
# define USE_DL_PREFIX 1
-# define MORECORE_CANNOT_TRIM 1
#else
# define __malloc_lock() mallock->acquire ()
# define __malloc_unlock() mallock->release ()
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index a2dd26674..80b58f067 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -768,6 +768,7 @@ _lseek = lseek
lseek64
lstat64
mallinfo
+mallinfo
malloc
_malloc = malloc
malloc_stats
diff --git a/winsup/cygwin/malloc_wrapper.cc b/winsup/cygwin/malloc_wrapper.cc
index bd671a6fc..14db2fd79 100644
--- a/winsup/cygwin/malloc_wrapper.cc
+++ b/winsup/cygwin/malloc_wrapper.cc
@@ -25,6 +25,8 @@ details. */
#include "sync.h"
#include "perprocess.h"
#include "cygmalloc.h"
+#include <malloc.h>
+extern "C" struct mallinfo dlmallinfo ();
/* we provide these stubs to call into a user's
provided malloc if there is one - otherwise
@@ -276,6 +278,22 @@ malloc_stats ()
return;
}
+extern "C" struct mallinfo
+mallinfo ()
+{
+ struct mallinfo m;
+ if (!use_internal_malloc)
+ set_errno (ENOSYS);
+ else
+ {
+ __malloc_lock ();
+ m = dlmallinfo ();
+ __malloc_unlock ();
+ }
+
+ return m;
+}
+
extern "C" char *
strdup (const char *s)
{