mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
Use VG_(arena_memalign) for thread array rather than VG_(malloc)-ed + align
Objective is to avoid a 'possibly lost' leak when self-hosting (and re-uses the already existing align logic in m_mallocfree.c) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15581
This commit is contained in:
parent
893c2a3f08
commit
9e871fd7ba
@ -54,14 +54,10 @@ UInt VG_N_THREADS;
|
||||
void VG_(init_Threads)(void)
|
||||
{
|
||||
ThreadId tid;
|
||||
UChar *addr, *aligned_addr;
|
||||
|
||||
addr = VG_(malloc)("init_Threads",
|
||||
VG_N_THREADS * sizeof VG_(threads)[0] + LibVEX_GUEST_STATE_ALIGN - 1);
|
||||
|
||||
// Align
|
||||
aligned_addr = addr + (Addr)addr % LibVEX_GUEST_STATE_ALIGN;
|
||||
VG_(threads) = (ThreadState *)aligned_addr;
|
||||
VG_(threads) = VG_(arena_memalign) (VG_AR_CORE, "init_Threads",
|
||||
LibVEX_GUEST_STATE_ALIGN,
|
||||
VG_N_THREADS * sizeof VG_(threads)[0]);
|
||||
|
||||
for (tid = 1; tid < VG_N_THREADS; tid++) {
|
||||
INNER_REQUEST(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user