|
From: <sv...@va...> - 2006-10-17 01:42:45
|
Author: sewardj
Date: 2006-10-17 02:42:40 +0100 (Tue, 17 Oct 2006)
New Revision: 6273
Log:
Merge r6136:
Track SysRes change; support bigpage allocation on AIX; make the
client-arena superblocks much bigger on AIX.
Modified:
trunk/coregrind/m_mallocfree.c
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 2006-10-17 01:42:00 UTC (rev 6272)
+++ trunk/coregrind/m_mallocfree.c 2006-10-17 01:42:40 UTC (rev 6273)
@@ -454,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
@@ -474,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 {
@@ -548,7 +558,6 @@
{
Superblock* sb;
SysRes sres;
- NSegment* seg;
=20
// Take into account admin bytes in the Superblock.
cszB +=3D sizeof(Superblock);
@@ -558,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);
|