[Issue 22985] New: dip1008 implementation uses the GC behind the scenes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 4 11:23:36 UTC 2022


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

          Issue ID: 22985
           Summary: dip1008 implementation uses the GC behind the scenes
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: razvan.nitu1305 at gmail.com

int foo(int) @nogc
{
    throw new Exception("huhu");
}

void test() @nogc
{
    try
    {
        foo(1);
    }
    catch(Exception e)
    {
    }
}

void main()
{
    import std.stdio;
    import core.memory;
    auto stats1 = GC.stats();
    test();
    auto stats2 = GC.stats();
    writeln(stats1); // Stats(0, 0, 0)
    writeln(stats2); // Stats(1376, 1047200, 1360)
}

Allocating the traceHandler still uses the GC

--


More information about the Digitalmars-d-bugs mailing list