ec_htab_size_idx = 0;
ec_htab_size = ec_primes[ec_htab_size_idx];
- ec_htab = VG_(arena_malloc)(VG_AR_EXECTXT, "execontext.iEs1",
- sizeof(ExeContext*) * ec_htab_size);
+ ec_htab = VG_(malloc)("execontext.iEs1",
+ sizeof(ExeContext*) * ec_htab_size);
for (i = 0; i < ec_htab_size; i++)
ec_htab[i] = NULL;
return; /* out of primes - can't resize further */
new_size = ec_primes[ec_htab_size_idx + 1];
- new_ec_htab = VG_(arena_malloc)(VG_AR_EXECTXT, "execontext.reh1",
- sizeof(ExeContext*) * new_size);
+ new_ec_htab = VG_(malloc)("execontext.reh1",
+ sizeof(ExeContext*) * new_size);
VG_(debugLog)(
1, "execontext",
}
}
- VG_(arena_free)(VG_AR_EXECTXT, ec_htab);
+ VG_(free)(ec_htab);
ec_htab = new_ec_htab;
ec_htab_size = new_size;
ec_htab_size_idx++;
/* Bummer. We have to allocate a new context record. */
ec_totstored++;
- new_ec = VG_(arena_perm_malloc)( VG_AR_EXECTXT,
- sizeof(struct _ExeContext)
- + n_ips * sizeof(Addr),
- vg_alignof(struct _ExeContext));
+ new_ec = VG_(perm_malloc)( sizeof(struct _ExeContext)
+ + n_ips * sizeof(Addr),
+ vg_alignof(struct _ExeContext));
for (i = 0; i < n_ips; i++)
new_ec->ips[i] = ips[i];
// Initialise the non-client arenas
// Similarly to client arena, big allocations will be unsplittable.
arena_init ( VG_AR_CORE, "core", CORE_REDZONE_DEFAULT_SZB,
- 1048576, 1048576+1 );
- arena_init ( VG_AR_TOOL, "tool", CORE_REDZONE_DEFAULT_SZB,
4194304, 4194304+1 );
arena_init ( VG_AR_DINFO, "dinfo", CORE_REDZONE_DEFAULT_SZB,
1048576, 1048576+1 );
arena_init ( VG_AR_DEMANGLE, "demangle", CORE_REDZONE_DEFAULT_SZB,
65536, 65536+1 );
- arena_init ( VG_AR_EXECTXT, "exectxt", CORE_REDZONE_DEFAULT_SZB,
- 1048576, 1048576+1 );
- arena_init ( VG_AR_ERRORS, "errors", CORE_REDZONE_DEFAULT_SZB,
- 65536, 65536+1 );
arena_init ( VG_AR_TTAUX, "ttaux", CORE_REDZONE_DEFAULT_SZB,
65536, 65536+1 );
nonclient_inited = True;
void* VG_(malloc) ( const HChar* cc, SizeT nbytes )
{
- return VG_(arena_malloc) ( VG_AR_TOOL, cc, nbytes );
+ return VG_(arena_malloc) ( VG_AR_CORE, cc, nbytes );
}
void VG_(free) ( void* ptr )
{
- VG_(arena_free) ( VG_AR_TOOL, ptr );
+ VG_(arena_free) ( VG_AR_CORE, ptr );
}
void* VG_(calloc) ( const HChar* cc, SizeT nmemb, SizeT bytes_per_memb )
{
- return VG_(arena_calloc) ( VG_AR_TOOL, cc, nmemb, bytes_per_memb );
+ return VG_(arena_calloc) ( VG_AR_CORE, cc, nmemb, bytes_per_memb );
}
void* VG_(realloc) ( const HChar* cc, void* ptr, SizeT size )
{
- return VG_(arena_realloc) ( VG_AR_TOOL, cc, ptr, size );
+ return VG_(arena_realloc) ( VG_AR_CORE, cc, ptr, size );
}
HChar* VG_(strdup) ( const HChar* cc, const HChar* s )
{
- return VG_(arena_strdup) ( VG_AR_TOOL, cc, s );
+ return VG_(arena_strdup) ( VG_AR_CORE, cc, s );
}
// Useful for querying user blocks.
void* VG_(perm_malloc) ( SizeT size, Int align )
{
- return VG_(arena_perm_malloc) ( VG_AR_TOOL, size, align );
+ return VG_(arena_perm_malloc) ( VG_AR_CORE, size, align );
}
/* Allocation arenas.
- CORE for the core's general use.
- TOOL for the tool to use (and the only one it uses).
+ CORE for the core's and tools' general use.
DINFO for debug info (symbols, line #s, CFI, etc) storage.
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.
TTAUX for storing TT/TC auxiliary structures (address range
equivalence classes).
*/
typedef Int ArenaId;
-#define VG_N_ARENAS 8
+#define VG_N_ARENAS 5
#define VG_AR_CORE 0
-#define VG_AR_TOOL 1
-#define VG_AR_DINFO 2
-#define VG_AR_CLIENT 3
-#define VG_AR_DEMANGLE 4
-#define VG_AR_EXECTXT 5
-#define VG_AR_ERRORS 6
-#define VG_AR_TTAUX 7
+#define VG_AR_DINFO 1
+#define VG_AR_CLIENT 2
+#define VG_AR_DEMANGLE 3
+#define VG_AR_TTAUX 4
// 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