From: Nicholas Nethercote Date: Sun, 13 Mar 2005 18:11:44 +0000 (+0000) Subject: Remove two malloc/free arenas: X-Git-Tag: svn/VALGRIND_3_0_0~976 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b4dd85ce0cdac0fc9282c60a2e57290facde7fe3;p=thirdparty%2Fvalgrind.git Remove two malloc/free arenas: - JITTER, which was unused, since Vex now manages its own memory - TRANSIENT, which was barely being used; I replaced it with usage of CORE git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3342 --- diff --git a/coregrind/core.h b/coregrind/core.h index fc0ba65dc1..1951565079 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -353,29 +353,25 @@ void VG_(sanity_check_needs)(void); CORE for the core's general use. TOOL for the tool to use (and the only one it uses). SYMTAB for Valgrind's symbol table storage. - JITTER for small storage during translation. CLIENT for the client's mallocs/frees, if the tool replaces glibc's malloc() et al -- redzone size is chosen by the tool. DEMANGLE for the C++ demangler. EXECTXT for storing ExeContexts. ERRORS for storing CoreErrors. - TRANSIENT for very short-term use. It should be empty in between uses. When adding a new arena, remember also to add it to ensure_mm_init(). */ typedef Int ArenaId; -#define VG_N_ARENAS 9 +#define VG_N_ARENAS 7 #define VG_AR_CORE 0 #define VG_AR_TOOL 1 #define VG_AR_SYMTAB 2 -#define VG_AR_JITTER 3 -#define VG_AR_CLIENT 4 -#define VG_AR_DEMANGLE 5 -#define VG_AR_EXECTXT 6 -#define VG_AR_ERRORS 7 -#define VG_AR_TRANSIENT 8 +#define VG_AR_CLIENT 3 +#define VG_AR_DEMANGLE 4 +#define VG_AR_EXECTXT 5 +#define VG_AR_ERRORS 6 // This is both the minimum payload size of a malloc'd block, and its // minimum alignment. Must be a power of 2 greater than 4, and should be diff --git a/coregrind/vg_malloc2.c b/coregrind/vg_malloc2.c index f0314162ae..75f5472e66 100644 --- a/coregrind/vg_malloc2.c +++ b/coregrind/vg_malloc2.c @@ -415,12 +415,10 @@ void ensure_mm_init ( void ) arena_init ( VG_AR_CORE, "core", 4, CORE_ARENA_MIN_SZB ); arena_init ( VG_AR_TOOL, "tool", 4, 1048576 ); arena_init ( VG_AR_SYMTAB, "symtab", 4, 1048576 ); - arena_init ( VG_AR_JITTER, "JITter", 4, 32768 ); arena_init ( VG_AR_CLIENT, "client", client_rz_szB, 1048576 ); arena_init ( VG_AR_DEMANGLE, "demangle", 12/*paranoid*/, 65536 ); arena_init ( VG_AR_EXECTXT, "exectxt", 4, 65536 ); arena_init ( VG_AR_ERRORS, "errors", 4, 65536 ); - arena_init ( VG_AR_TRANSIENT, "transien", 4, 65536 ); init_done = True; # ifdef DEBUG_MALLOC diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c index 9c24a5be84..d8a7426b9a 100644 --- a/coregrind/vg_syscalls.c +++ b/coregrind/vg_syscalls.c @@ -677,19 +677,19 @@ static void pre_mem_read_sendmsg ( ThreadId tid, Char *msg, Addr base, SizeT size ) { - Char *outmsg = strdupcat ( "socketcall.sendmsg", msg, VG_AR_TRANSIENT ); + Char *outmsg = strdupcat ( "socketcall.sendmsg", msg, VG_AR_CORE ); PRE_MEM_READ( outmsg, base, size ); - VG_(arena_free) ( VG_AR_TRANSIENT, outmsg ); + VG_(arena_free) ( VG_AR_CORE, outmsg ); } static void pre_mem_write_recvmsg ( ThreadId tid, Char *msg, Addr base, SizeT size ) { - Char *outmsg = strdupcat ( "socketcall.recvmsg", msg, VG_AR_TRANSIENT ); + Char *outmsg = strdupcat ( "socketcall.recvmsg", msg, VG_AR_CORE ); PRE_MEM_WRITE( outmsg, base, size ); - VG_(arena_free) ( VG_AR_TRANSIENT, outmsg ); + VG_(arena_free) ( VG_AR_CORE, outmsg ); } static @@ -769,7 +769,7 @@ void pre_mem_read_sockaddr ( ThreadId tid, /* NULL/zero-length sockaddrs are legal */ if ( sa == NULL || salen == 0 ) return; - outmsg = VG_(arena_malloc) ( VG_AR_TRANSIENT, + outmsg = VG_(arena_malloc) ( VG_AR_CORE, VG_(strlen)( description ) + 30 ); VG_(sprintf) ( outmsg, description, ".sa_family" ); @@ -819,7 +819,7 @@ void pre_mem_read_sockaddr ( ThreadId tid, break; } - VG_(arena_free) ( VG_AR_TRANSIENT, outmsg ); + VG_(arena_free) ( VG_AR_CORE, outmsg ); } /* Dereference a pointer to a UInt. */