about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-07-11 15:46:17 +0000
committerUlrich Drepper <drepper@redhat.com>2002-07-11 15:46:17 +0000
commit1ae915d98db1e07cf332e8a1fc86f3432f5c3614 (patch)
tree88b55eacd0167551989d7caed1a657151e420e09
parent9d957ce2a2cfefb4580e37b744b581381604106f (diff)
downloadglibc-1ae915d98db1e07cf332e8a1fc86f3432f5c3614.tar.gz
glibc-1ae915d98db1e07cf332e8a1fc86f3432f5c3614.tar.xz
glibc-1ae915d98db1e07cf332e8a1fc86f3432f5c3614.zip
Update.
2002-07-06  Bruno Haible  <bruno@clisp.org>

	* malloc/hooks.c (public_gET_STATe): Access max_total_mem in mp_.
-rw-r--r--ChangeLog4
-rw-r--r--malloc/hooks.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 263f1dcf6f..6a402b1056 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-06  Bruno Haible  <bruno@clisp.org>
+
+	* malloc/hooks.c (public_gET_STATe): Access max_total_mem in mp_.
+
 2002-07-11  Ulrich Drepper  <drepper@redhat.com>
 
 	* resolv/res_hconf.c (_res_hconf_init): Move code into new
diff --git a/malloc/hooks.c b/malloc/hooks.c
index 87b9e52e43..feb7b2da93 100644
--- a/malloc/hooks.c
+++ b/malloc/hooks.c
@@ -352,8 +352,11 @@ realloc_check(oldmem, bytes, caller)
   if (chunk_is_mmapped(oldp)) {
 #if HAVE_MREMAP
     mchunkptr newp = mremap_chunk(oldp, nb);
-    if(!newp) {
+    if(newp)
+      newmem = chunk2mem(newp);
+    else
 #endif
+    {
       /* Note the extra SIZE_SZ overhead. */
       if(oldsize - SIZE_SZ >= nb)
 	newmem = oldmem; /* do nothing */
@@ -366,11 +369,7 @@ realloc_check(oldmem, bytes, caller)
           munmap_chunk(oldp);
         }
       }
-#if HAVE_MREMAP
-    } else {
-      newmem = chunk2mem(newp);
     }
-#endif
   } else {
 #endif /* HAVE_MMAP */
     if (top_check() >= 0)
@@ -534,7 +533,7 @@ public_gET_STATe(void)
   ms->check_action = check_action;
   ms->max_sbrked_mem = main_arena.max_system_mem;
 #ifdef NO_THREADS
-  ms->max_total_mem = max_total_mem;
+  ms->max_total_mem = mp_.max_total_mem;
 #else
   ms->max_total_mem = 0;
 #endif