Move VG_(get_memory_from_mmap_for_client) out of m_aspacemgr into
m_libcmman, next to VG_(get_memory_from_mmap). Removes the (direct)
dependence of m_mallocfree on m_aspacemgr.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3962 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_libcmman.c b/coregrind/m_libcmman.c
index 3499fe5..9270eef 100644
--- a/coregrind/m_libcmman.c
+++ b/coregrind/m_libcmman.c
@@ -166,6 +166,25 @@
VG_(exit)(1);
}
+// Returns 0 on failure.
+Addr VG_(get_memory_from_mmap_for_client)
+ (Addr addr, SizeT len, UInt prot, UInt sf_flags)
+{
+ len = VG_PGROUNDUP(len);
+
+ tl_assert(!(sf_flags & SF_FIXED));
+ tl_assert(0 == addr);
+
+ addr = (Addr)VG_(mmap)((void *)addr, len, prot,
+ VKI_MAP_PRIVATE | VKI_MAP_ANONYMOUS | VKI_MAP_CLIENT,
+ sf_flags | SF_CORE, -1, 0);
+ if ((Addr)-1 != addr)
+ return addr;
+ else
+ return 0;
+}
+
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/