Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
regression test for Issue 3454
Browse files Browse the repository at this point in the history
  • Loading branch information
Safety0ff committed Oct 30, 2013
1 parent 4fe17c3 commit 487f0a1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/rt/lifetime.d
Expand Up @@ -2380,3 +2380,18 @@ unittest
assert(s4.x == null);
assert(gc_getAttr(s4) == 0);
}

unittest
{
import core.memory;
// Bugzilla 3454 - Inconsistent flag setting in GC.realloc()
static void test(size_t multiplier)
{
auto p = GC.malloc(8 * multiplier, BlkAttr.NO_SCAN);
assert(GC.getAttr(p) == BlkAttr.NO_SCAN);
p = GC.realloc(p, 2 * multiplier, BlkAttr.NO_SCAN);
assert(GC.getAttr(p) == BlkAttr.NO_SCAN);
}
test(1);
test(1024 * 1024);
}

0 comments on commit 487f0a1

Please sign in to comment.