From: Julian Seward Date: Wed, 16 Mar 2005 12:11:12 +0000 (+0000) Subject: Get rid of VG_(client_free) as it was never used. Rename its X-Git-Tag: svn/VALGRIND_3_0_0~942 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f6401271ca854b3896aee263cdaee25d80cf894f;p=thirdparty%2Fvalgrind.git Get rid of VG_(client_free) as it was never used. Rename its 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 --- diff --git a/coregrind/vg_malloc2.c b/coregrind/vg_malloc2.c index 248fc5ba33..6e3514e46d 100644 --- a/coregrind/vg_malloc2.c +++ b/coregrind/vg_malloc2.c @@ -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 { diff --git a/coregrind/vg_memory.c b/coregrind/vg_memory.c index 1290f5f9d4..34119faddf 100644 --- a/coregrind/vg_memory.c +++ b/coregrind/vg_memory.c @@ -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. */ diff --git a/include/tool.h.base b/include/tool.h.base index 871b2ca25b..e3439466cc 100644 --- a/include/tool.h.base +++ b/include/tool.h.base @@ -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);