[Issue 3454] Inconsistent flag setting in GC.realloc()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 25 12:07:58 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=3454


safety0ff.bugz <safety0ff.bugz at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |safety0ff.bugz at gmail.com


--- Comment #1 from safety0ff.bugz <safety0ff.bugz at gmail.com> 2013-10-25 12:07:56 PDT ---
I believe your test should be:
------------------------------------------------
import std.stdio, core.memory;

void main() {
    doTest(1);
    writeln();
    doTest(1024 * 1024);
}

void doTest(size_t multiplier) {
    auto foo = GC.malloc(8 * multiplier);
    writeln("Old block attributes:  ", GC.getAttr(foo));

    auto bar = GC.realloc(foo, 2 * multiplier, GC.BlkAttr.NO_SCAN);
    writeln("New block attributes:  ", GC.getAttr(bar));
    writeln("Old Ptr:  ", foo, "  New Ptr:  ", bar);
}
-------------------------------------------------
I've put an ugly fix for this here:
https://github.com/Safety0ff/druntime/commit/14148c8184b7094243f5ab74d703027d05c6e73a

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list