mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-06 11:41:34 +00:00
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
This commit is contained in:
parent
d2bc233d5e
commit
b4dd85ce0c
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user