www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16285] New: IAllocator crash

https://issues.dlang.org/show_bug.cgi?id=16285

          Issue ID: 16285
           Summary: IAllocator crash
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: luis luismarques.eu

void main()
{
    import std.exception;
    import std.experimental.allocator;
    import std.experimental.allocator.building_blocks.region;
    import std.stdio;

    static InSituRegion!1024 ralloc;
    IAllocator alloc = allocatorObject(&ralloc);

    enforce(alloc.make!int !is null);
    enforce(alloc.deallocateAll());

    enforce(alloc.make!int !is null);
    writeln("OK 1");

    enforce(alloc.deallocateAll());
    writeln("OK 2");
}

$ rdmd -g test.d
OK 1
Segmentation fault: 11

--
Jul 16 2016