]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Move VG_(get_memory_from_mmap_for_client) out of m_aspacemgr into
authorNicholas Nethercote <njn@valgrind.org>
Sun, 19 Jun 2005 21:57:54 +0000 (21:57 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 19 Jun 2005 21:57:54 +0000 (21:57 +0000)
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

coregrind/m_aspacemgr/aspacemgr.c
coregrind/m_libcmman.c
coregrind/m_mallocfree.c
coregrind/pub_core_aspacemgr.h
coregrind/pub_core_libcmman.h

index 2003660671d78adbe79820d9fc85846d393651de..ef109d420592caa906538c8401c0eec146791b54 100644 (file)
@@ -1372,28 +1372,9 @@ Bool VG_(is_addressable)(Addr p, SizeT size, UInt prot)
 
 
 /*--------------------------------------------------------------------*/
-/*--- Manage allocation of memory on behalf of the client          ---*/
+/*--- Random function that doesn't really belong here              ---*/
 /*--------------------------------------------------------------------*/
 
-// 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;
-}
-
-
 /* We'll call any RW mmaped memory segment, within the client address
    range, which isn't SF_CORE, a root. 
 */
index 3499fe570aff31ef5bb70326f91a27c5021d854f..9270eef88855df1d7418b6f31c5c448e206c994f 100644 (file)
@@ -166,6 +166,25 @@ void* VG_(get_memory_from_mmap) ( SizeT nBytes, Char* who )
    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                                                          ---*/
 /*--------------------------------------------------------------------*/
index 28ea67cef1b46aa28a250b5c11419517ede6664a..35730c147dc356a4453c437973348e0eb74c52f6 100644 (file)
@@ -30,7 +30,6 @@
 */
 
 #include "pub_core_basics.h"
-#include "pub_core_aspacemgr.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcassert.h"
 #include "pub_core_libcmman.h"
index 8a36d436b3dfa43bfeda765c40e751f18391089d..26a92a3b5cb02d3c60c209d32b0fe8c563a65aaa 100644 (file)
@@ -145,9 +145,6 @@ extern VGA_REGPARM(2)
 /* Return string for prot */
 extern const HChar *VG_(prot_str)(UInt prot);
 
-extern Addr VG_(get_memory_from_mmap_for_client)
-               (Addr base, SizeT len, UInt prot, UInt flags);
-
 /* Parses /proc/self/maps, calling `record_mapping' for each entry. */
 extern 
 void VG_(parse_procselfmaps) (
index 1219a41eb25658bd022dbd9dc2bcbd970c5366d2..a537405ac601b1ef35af86ccf8510bf951f21642 100644 (file)
@@ -48,6 +48,9 @@ extern SysRes VG_(mmap_native)     ( void* start, SizeT length, UInt prot,
 extern SysRes VG_(munmap_native)   ( void* start, SizeT length );
 extern SysRes VG_(mprotect_native) ( void *start, SizeT length, UInt prot );
 
+extern Addr VG_(get_memory_from_mmap_for_client)
+               (Addr base, SizeT len, UInt prot, UInt flags);
+
 #endif   // __PUB_CORE_LIBCMMAN_H
 
 /*--------------------------------------------------------------------*/