|
From: <sv...@va...> - 2005-06-19 21:57:56
|
Author: njn
Date: 2005-06-19 22:57:54 +0100 (Sun, 19 Jun 2005)
New Revision: 3962
Log:
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.
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_libcmman.c
trunk/coregrind/m_mallocfree.c
trunk/coregrind/pub_core_aspacemgr.h
trunk/coregrind/pub_core_libcmman.h
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-19 21:49:28 UTC (rev =
3961)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-19 21:57:54 UTC (rev =
3962)
@@ -1372,28 +1372,9 @@
=20
=20
/*--------------------------------------------------------------------*/
-/*--- Manage allocation of memory on behalf of the client ---*/
+/*--- Random function that doesn't really belong here ---*/
/*--------------------------------------------------------------------*/
=20
-// Returns 0 on failure.
-Addr VG_(get_memory_from_mmap_for_client)
- (Addr addr, SizeT len, UInt prot, UInt sf_flags)
-{
- len =3D VG_PGROUNDUP(len);
-
- tl_assert(!(sf_flags & SF_FIXED));
- tl_assert(0 =3D=3D addr);
-
- addr =3D (Addr)VG_(mmap)((void *)addr, len, prot,=20
- VKI_MAP_PRIVATE | VKI_MAP_ANONYMOUS | VKI_MAP_=
CLIENT,
- sf_flags | SF_CORE, -1, 0);
- if ((Addr)-1 !=3D 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.=20
*/
Modified: trunk/coregrind/m_libcmman.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_libcmman.c 2005-06-19 21:49:28 UTC (rev 3961)
+++ trunk/coregrind/m_libcmman.c 2005-06-19 21:57:54 UTC (rev 3962)
@@ -166,6 +166,25 @@
VG_(exit)(1);
}
=20
+// Returns 0 on failure.
+Addr VG_(get_memory_from_mmap_for_client)
+ (Addr addr, SizeT len, UInt prot, UInt sf_flags)
+{
+ len =3D VG_PGROUNDUP(len);
+
+ tl_assert(!(sf_flags & SF_FIXED));
+ tl_assert(0 =3D=3D addr);
+
+ addr =3D (Addr)VG_(mmap)((void *)addr, len, prot,=20
+ VKI_MAP_PRIVATE | VKI_MAP_ANONYMOUS | VKI_MAP_=
CLIENT,
+ sf_flags | SF_CORE, -1, 0);
+ if ((Addr)-1 !=3D addr)
+ return addr;
+ else
+ return 0;
+}
+
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_mallocfree.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_mallocfree.c 2005-06-19 21:49:28 UTC (rev 3961)
+++ trunk/coregrind/m_mallocfree.c 2005-06-19 21:57:54 UTC (rev 3962)
@@ -30,7 +30,6 @@
*/
=20
#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"
Modified: trunk/coregrind/pub_core_aspacemgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_aspacemgr.h 2005-06-19 21:49:28 UTC (rev 396=
1)
+++ trunk/coregrind/pub_core_aspacemgr.h 2005-06-19 21:57:54 UTC (rev 396=
2)
@@ -145,9 +145,6 @@
/* Return string for prot */
extern const HChar *VG_(prot_str)(UInt prot);
=20
-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=20
void VG_(parse_procselfmaps) (
Modified: trunk/coregrind/pub_core_libcmman.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_libcmman.h 2005-06-19 21:49:28 UTC (rev 3961=
)
+++ trunk/coregrind/pub_core_libcmman.h 2005-06-19 21:57:54 UTC (rev 3962=
)
@@ -48,6 +48,9 @@
extern SysRes VG_(munmap_native) ( void* start, SizeT length );
extern SysRes VG_(mprotect_native) ( void *start, SizeT length, UInt pro=
t );
=20
+extern Addr VG_(get_memory_from_mmap_for_client)
+ (Addr base, SizeT len, UInt prot, UInt flags);
+
#endif // __PUB_CORE_LIBCMMAN_H
=20
/*--------------------------------------------------------------------*/
|