<varlistentry id="opt.freelist-vol" xreflabel="--freelist-vol">
<term>
- <option><![CDATA[--freelist-vol=<number> [default: 5000000] ]]></option>
+ <option><![CDATA[--freelist-vol=<number> [default: 10000000] ]]></option>
</term>
<listitem>
<para>When the client program releases memory using
have been freed.</para>
<para>This flag specifies the maximum total size, in bytes, of the
- blocks in the queue. The default value is five million bytes.
+ blocks in the queue. The default value is ten million bytes.
Increasing this increases the total amount of memory used by
<constant>memcheck</constant> but may detect invalid uses of freed
blocks which would otherwise go undetected.</para>
extern Bool MC_(clo_partial_loads_ok);
/* Max volume of the freed blocks queue. */
-extern SSizeT MC_(clo_freelist_vol);
+extern Long MC_(clo_freelist_vol);
/* Do leak check at exit? default: NO */
extern LeakCheckMode MC_(clo_leak_check);
/*------------------------------------------------------------*/
Bool MC_(clo_partial_loads_ok) = False;
-SSizeT MC_(clo_freelist_vol) = 5000000;
+Long MC_(clo_freelist_vol) = 10*1000*1000LL;
LeakCheckMode MC_(clo_leak_check) = LC_Summary;
VgRes MC_(clo_leak_resolution) = Vg_LowRes;
Bool MC_(clo_show_reachable) = False;
else VG_BOOL_CLO(arg, "--undef-value-errors", MC_(clo_undef_value_errors))
- else VG_BNUM_CLO(arg, "--freelist-vol", MC_(clo_freelist_vol), 0, 1000000000)
+ else VG_BNUM_CLO(arg, "--freelist-vol", MC_(clo_freelist_vol),
+ 0, 10*1000*1000*1000LL)
else if (VG_CLO_STREQ(arg, "--leak-check=no"))
MC_(clo_leak_check) = LC_Off;
" --show-reachable=no|yes show reachable blocks in leak check? [no]\n"
" --undef-value-errors=no|yes check for undefined value errors [yes]\n"
" --partial-loads-ok=no|yes too hard to explain here; see manual [no]\n"
-" --freelist-vol=<number> volume of freed blocks queue [5000000]\n"
+" --freelist-vol=<number> volume of freed blocks queue [10000000]\n"
" --workaround-gcc296-bugs=no|yes self explanatory [no]\n"
" --ignore-ranges=0xPP-0xQQ[,0xRR-0xSS] assume given addresses are OK\n"
);
/* Records blocks after freeing. */
static MC_Chunk* freed_list_start = NULL;
static MC_Chunk* freed_list_end = NULL;
-static SSizeT freed_list_volume = 0;
+static Long freed_list_volume = 0;
/* Put a shadow chunk on the freed blocks queue, possibly freeing up
some of the oldest blocks in the queue at the same time. */
static void add_to_freed_queue ( MC_Chunk* mc )
{
+ const Bool show = False;
+
/* Put it at the end of the freed list */
if (freed_list_end == NULL) {
tl_assert(freed_list_start == NULL);
freed_list_end = freed_list_start = mc;
- freed_list_volume = mc->szB;
+ freed_list_volume = (Long)mc->szB;
} else {
tl_assert(freed_list_end->next == NULL);
freed_list_end->next = mc;
freed_list_end = mc;
- freed_list_volume += mc->szB;
+ freed_list_volume += (Long)mc->szB;
+ if (show)
+ VG_(printf)("mc_freelist: acquire: volume now %lld\n",
+ freed_list_volume);
}
mc->next = NULL;
tl_assert(freed_list_end != NULL);
mc1 = freed_list_start;
- freed_list_volume -= mc1->szB;
- /* VG_(printf)("volume now %d\n", freed_list_volume); */
+ freed_list_volume -= (Long)mc1->szB;
+ if (show)
+ VG_(printf)("mc_freelist: discard: volume now %lld\n",
+ freed_list_volume);
tl_assert(freed_list_volume >= 0);
if (freed_list_start == freed_list_end) {
}
/* Allocate memory and note change in memory available */
-__inline__
void* MC_(new_block) ( ThreadId tid,
Addr p, SizeT szB, SizeT alignB, UInt rzB,
Bool is_zeroed, MC_AllocKind kind, VgHashTable table)
}
}
-__inline__
void MC_(handle_free) ( ThreadId tid, Addr p, UInt rzB, MC_AllocKind kind )
{
MC_Chunk* mc;