|
From: <sv...@va...> - 2006-10-01 23:14:14
|
Author: sewardj
Date: 2006-10-02 00:14:11 +0100 (Mon, 02 Oct 2006)
New Revision: 6136
Log:
Track SysRes change; support bigpage allocation on AIX; make the
client-arena superblocks much bigger on AIX.
Modified:
branches/AIX5/coregrind/m_mallocfree.c
Modified: branches/AIX5/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
--- branches/AIX5/coregrind/m_mallocfree.c 2006-10-01 23:08:53 UTC (rev 6=
135)
+++ branches/AIX5/coregrind/m_mallocfree.c 2006-10-01 23:14:11 UTC (rev 6=
136)
@@ -30,6 +30,7 @@
*/
=20
#include "pub_core_basics.h"
+#include "pub_core_vki.h"
#include "pub_core_debuglog.h"
#include "pub_core_libcbase.h"
#include "pub_core_aspacemgr.h"
@@ -453,6 +454,7 @@
larger prev/next ptr.
*/
if (VG_AR_CLIENT =3D=3D aid) {
+ Int ar_client_sbszB;
if (client_inited) {
// This assertion ensures that a tool cannot try to change the =
client
// redzone size with VG_(needs_malloc_replacement)() after this=
module
@@ -473,8 +475,17 @@
VG_(exit)(1);
}
}
- // Initialise the client arena
- arena_init ( VG_AR_CLIENT, "client", client_rz_szB, 1048576 )=
;
+ // Initialise the client arena. On AIX it's important to have
+ // relatively large client blocks so as not to cause excessively
+ // fine-grained interleaving of V and C address space. On Linux
+ // this is irrelevant since aspacem can keep the two spaces
+ // well apart, but not so on AIX.
+# if defined(VGO_aix5)
+ ar_client_sbszB =3D 16777216;
+# else
+ ar_client_sbszB =3D 1048576;
+# endif
+ arena_init ( VG_AR_CLIENT, "client", client_rz_szB, ar_client=
_sbszB );
client_inited =3D True;
=20
} else {
@@ -547,7 +558,6 @@
{
Superblock* sb;
SysRes sres;
- NSegment* seg;
=20
// Take into account admin bytes in the Superblock.
cszB +=3D sizeof(Superblock);
@@ -557,26 +567,26 @@
=20
if (a->clientmem) {
// client allocation -- return 0 to client if it fails
- sres =3D VG_(am_mmap_anon_float_client)
+ sres =3D VG_(am_sbrk_anon_float_client)
( cszB, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC );
if (sres.isError)
return 0;
- sb =3D (Superblock*)sres.val;
+ sb =3D (Superblock*)sres.res;
// Mark this segment as containing client heap. The leak
// checker needs to be able to identify such segments so as not
// to use them as sources of roots during leak checks.
- seg =3D VG_(am_find_nsegment)( (Addr)sb );
- vg_assert(seg && seg->kind =3D=3D SkAnonC);
- seg->isCH =3D True;
+ VG_(am_set_segment_isCH_if_SkAnonC)(=20
+ (NSegment*) VG_(am_find_nsegment)( (Addr)sb )
+ );
} else {
// non-client allocation -- abort if it fails
- sres =3D VG_(am_mmap_anon_float_valgrind)( cszB );
+ sres =3D VG_(am_sbrk_anon_float_valgrind)( cszB );
if (sres.isError) {
VG_(out_of_memory_NORETURN)("newSuperblock", cszB);
/* NOTREACHED */
sb =3D NULL; /* keep gcc happy */
} else {
- sb =3D (Superblock*)sres.val;
+ sb =3D (Superblock*)sres.res;
}
}
vg_assert(NULL !=3D sb);
|