From: Philippe Waroquiers Date: Sun, 20 Apr 2014 19:50:13 +0000 (+0000) Subject: Cleanup some old leftover of AIX port + fix a comment X-Git-Tag: svn/VALGRIND_3_10_0~534 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a05f43f0115bfef56b415a70916a005ec835d1e0;p=thirdparty%2Fvalgrind.git Cleanup some old leftover of AIX port + fix a comment git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13902 --- diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 2633f4f055..dddbe37b52 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -2421,21 +2421,6 @@ SysRes VG_(am_mmap_anon_float_client) ( SizeT length, Int prot ) } -/* Similarly, acquire new address space for the client but with - considerable restrictions on what can be done with it: (1) the - actual protections may exceed those stated in 'prot', (2) the - area's protections cannot be later changed using any form of - mprotect, and (3) the area cannot be freed using any form of - munmap. On Linux this behaves the same as - VG_(am_mmap_anon_float_client). On AIX5 this *may* allocate memory - by using sbrk, so as to make use of large pages on AIX. */ - -SysRes VG_(am_sbrk_anon_float_client) ( SizeT length, Int prot ) -{ - return VG_(am_mmap_anon_float_client) ( length, prot ); -} - - /* Map anonymously at an unconstrained address for V, and update the segment array accordingly. This is fundamentally how V allocates itself more address space when needed. */ @@ -2541,15 +2526,6 @@ void* VG_(am_shadow_alloc)(SizeT size) return sr_isError(sres) ? NULL : (void*)sr_Res(sres); } -/* Same comments apply as per VG_(am_sbrk_anon_float_client). On - Linux this behaves the same as VG_(am_mmap_anon_float_valgrind). */ - -SysRes VG_(am_sbrk_anon_float_valgrind)( SizeT cszB ) -{ - return VG_(am_mmap_anon_float_valgrind)( cszB ); -} - - /* Map a file at an unconstrained address for V, and update the segment array accordingly. Use the provided flags */ diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index 95806b4f8d..411899bd82 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -815,12 +815,8 @@ Superblock* newSuperblock ( Arena* a, SizeT cszB ) if (a->clientmem) { // client allocation -- return 0 to client if it fails - if (unsplittable) - sres = VG_(am_mmap_anon_float_client) - ( cszB, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC ); - else - sres = VG_(am_sbrk_anon_float_client) - ( cszB, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC ); + sres = VG_(am_mmap_anon_float_client) + ( cszB, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC ); if (sr_isError(sres)) return 0; sb = (Superblock*)(AddrH)sr_Res(sres); @@ -830,10 +826,7 @@ Superblock* newSuperblock ( Arena* a, SizeT cszB ) VG_(am_set_segment_isCH_if_SkAnonC)( VG_(am_find_nsegment)( (Addr)sb ) ); } else { // non-client allocation -- abort if it fails - if (unsplittable) - sres = VG_(am_mmap_anon_float_valgrind)( cszB ); - else - sres = VG_(am_sbrk_anon_float_valgrind)( cszB ); + sres = VG_(am_mmap_anon_float_valgrind)( cszB ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("newSuperblock", cszB); /* NOTREACHED */ @@ -1610,7 +1603,7 @@ void* VG_(arena_malloc) ( ArenaId aid, const HChar* cc, SizeT req_pszB ) vg_assert(a->sblocks_used <= a->sblocks_size); if (a->sblocks_used == a->sblocks_size) { Superblock ** array; - SysRes sres = VG_(am_sbrk_anon_float_valgrind)(sizeof(Superblock *) * + SysRes sres = VG_(am_mmap_anon_float_valgrind)(sizeof(Superblock *) * a->sblocks_size * 2); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("arena_init", sizeof(Superblock *) * diff --git a/coregrind/pub_core_aspacemgr.h b/coregrind/pub_core_aspacemgr.h index b6b4e4f8fc..a9ea5302a1 100644 --- a/coregrind/pub_core_aspacemgr.h +++ b/coregrind/pub_core_aspacemgr.h @@ -229,27 +229,11 @@ extern SysRes VG_(am_mmap_anon_fixed_client) update the segment array accordingly. */ extern SysRes VG_(am_mmap_anon_float_client) ( SizeT length, Int prot ); -/* Similarly, acquire new address space for the client but with - considerable restrictions on what can be done with it: (1) the - actual protections may exceed those stated in 'prot', (2) the - area's protections cannot be later changed using any form of - mprotect, and (3) the area cannot be freed using any form of - munmap. On Linux this behaves the same as - VG_(am_mmap_anon_float_client). On AIX5 this *may* allocate memory - by using sbrk, so as to make use of large pages on AIX. */ -extern SysRes VG_(am_sbrk_anon_float_client) ( SizeT length, Int prot ); - - /* Map anonymously at an unconstrained address for V, and update the segment array accordingly. This is fundamentally how V allocates itself more address space when needed. */ extern SysRes VG_(am_mmap_anon_float_valgrind)( SizeT cszB ); -/* Same comments apply as per VG_(am_sbrk_anon_float_client). On - Linux this behaves the same as VG_(am_mmap_anon_float_valgrind). */ -extern SysRes VG_(am_sbrk_anon_float_valgrind)( SizeT cszB ); - - /* Map privately a file at an unconstrained address for V, and update the segment array accordingly. This is used by V for transiently mapping in object files to read their debug info. */ @@ -363,7 +347,7 @@ typedef VgStack; -/* Allocate and initialise a VgStack (anonymous client space). +/* Allocate and initialise a VgStack (anonymous valgrind space). Protect the stack active area and the guard areas appropriately. Returns NULL on failure, else the address of the bottom of the stack. On success, also sets *initial_sp to what the stack pointer