]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Get rid of VG_(client_free) as it was never used. Rename its
authorJulian Seward <jseward@acm.org>
Wed, 16 Mar 2005 12:11:12 +0000 (12:11 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 16 Mar 2005 12:11:12 +0000 (12:11 +0000)
counterpart VG_(client_alloc) to VG_(get_memory_from_mmap_for_client).
Man, this low level memory management is an undisciplined mess.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3376

coregrind/vg_malloc2.c
coregrind/vg_memory.c
include/tool.h.base

index 248fc5ba3344b2db7ca41f529b924041afe34e08..6e3514e46df10060ad3d6060adfd47fee7aef1cf 100644 (file)
@@ -468,8 +468,8 @@ Superblock* newSuperblock ( Arena* a, SizeT cszB )
    } else if (a->clientmem) {
       // client allocation -- return 0 to client if it fails
       sb = (Superblock *)
-           VG_(client_alloc)(0, cszB,
-                             VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC, 0);
+           VG_(get_memory_from_mmap_for_client)
+              (0, cszB, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC, 0);
       if (NULL == sb)
          return 0;
    } else {
index 1290f5f9d409ecbb8c9f7715b4ac559e0fc28175..34119faddf61e457d8dfc04239a9193311669404 100644 (file)
@@ -1145,7 +1145,8 @@ Bool VG_(is_addressable)(Addr p, SizeT size, UInt prot)
 /*--------------------------------------------------------------------*/
 
 // Returns 0 on failure.
-Addr VG_(client_alloc)(Addr addr, SizeT len, UInt prot, UInt sf_flags)
+Addr VG_(get_memory_from_mmap_for_client)
+        (Addr addr, SizeT len, UInt prot, UInt sf_flags)
 {
    len = PGROUNDUP(len);
 
@@ -1161,18 +1162,6 @@ Addr VG_(client_alloc)(Addr addr, SizeT len, UInt prot, UInt sf_flags)
       return 0;
 }
 
-void VG_(client_free)(Addr addr)
-{
-   Segment *s = VG_(find_segment)(addr);
-
-vg_assert(0);
-   if (s == NULL || s->addr != addr || !(s->flags & SF_CORE)) {
-      VG_(message)(Vg_DebugMsg, "VG_(client_free)(%p) - no CORE memory found there", addr);
-      return;
-   }
-
-   VG_(munmap)((void *)s->addr, s->len);
-}
 
 /* We'll call any RW mmaped memory segment, within the client address
    range, which isn't SF_CORE, a root. */
index 871b2ca25bcc3ddc41f68c45abac96abe04b538d..e3439466cc5388ca9ce0a389cc16a9192ef3b72f 100644 (file)
@@ -485,8 +485,8 @@ extern void *VG_(shadow_alloc)(UInt size);
 
 extern Bool VG_(is_addressable)(Addr p, SizeT sz, UInt prot);
 
-extern Addr VG_(client_alloc)(Addr base, SizeT len, UInt prot, UInt flags);
-extern void VG_(client_free)(Addr addr);
+extern Addr VG_(get_memory_from_mmap_for_client)
+               (Addr base, SizeT len, UInt prot, UInt flags);
 
 extern Bool VG_(is_valgrind_addr)(Addr a);