import cstdlib = tango.stdc.stdlib;
import cstring = tango.stdc.string;
+import cstdio = tango.stdc.stdio;
/*
* This is a small optimization that proved it's usefulness. For small chunks
return BlkInfo.init;
BlkInfo info;
info.base = pool.findBase(p);
+ if (info.base is null)
+ return BlkInfo.init;
info.size = pool.findSize(info.base);
info.attr = getAttr(pool, cast(size_t)(info.base - pool.baseAddr) / 16u);
if (has_pointermap(info.attr)) {
gc.stats.world_stopped();
if (opts.options.fork) {
+ cstdio.fflush(null); // avoid duplicated FILE* output
os.pid_t child_pid = os.fork();
assert (child_pid != -1); // don't accept errors in non-release mode
switch (child_pid) {
{
debug(COLLECT_PRINTF) printf("\tmark()\n");
- gc.p_cache = null;
- gc.size_cache = 0;
-
gc.any_changes = false;
for (size_t n = 0; n < gc.pools.length; n++)
{
{
// Free up everything not marked
debug(COLLECT_PRINTF) printf("\tsweep\n");
+ gc.p_cache = null;
+ gc.size_cache = 0;
size_t freedpages = 0;
size_t freed = 0;
for (size_t n = 0; n < gc.pools.length; n++)
{
for (; p < ptop; p += size, bit_i += bit_stride)
{
- if (pool.finals.nbits && pool.finals.testClear(bit_i)) {
+ if (pool.finals.testClear(bit_i)) {
if (opts.options.sentinel)
rt_finalize(sentinel_add(p), false/*gc.no_stack > 0*/);
else
sentinel_Invariant(sentinel_add(p));
pool.freebits.set(bit_i);
- if (pool.finals.nbits && pool.finals.testClear(bit_i)) {
+ if (pool.finals.testClear(bit_i)) {
if (opts.options.sentinel)
rt_finalize(sentinel_add(p), false/*gc.no_stack > 0*/);
else
byte *p = pool.baseAddr + pn * PAGESIZE;
if (opts.options.sentinel)
sentinel_Invariant(sentinel_add(p));
- if (pool.finals.nbits && pool.finals.testClear(bit_i)) {
+ if (pool.finals.testClear(bit_i)) {
if (opts.options.sentinel)
rt_finalize(sentinel_add(p), false/*gc.no_stack > 0*/);
else
body
{
uint attrs;
-
- if (pool.finals.nbits &&
- pool.finals.test(bit_i))
+ if (pool.finals.test(bit_i))
attrs |= BlkAttr.FINALIZE;
if (pool.noscan.test(bit_i))
attrs |= BlkAttr.NO_SCAN;
-// if (pool.nomove.nbits &&
-// pool.nomove.test(bit_i))
+// if (pool.nomove.test(bit_i))
// attrs |= BlkAttr.NO_MOVE;
return attrs;
}
{
if (mask & BlkAttr.FINALIZE)
{
- if (!pool.finals.nbits)
- pool.finals.alloc(pool.mark.nbits);
pool.finals.set(bit_i);
}
if (mask & BlkAttr.NO_SCAN)
}
body
{
- if (mask & BlkAttr.FINALIZE && pool.finals.nbits)
+ if (mask & BlkAttr.FINALIZE)
pool.finals.clear(bit_i);
if (mask & BlkAttr.NO_SCAN)
pool.noscan.clear(bit_i);