[Issue 13859] New: Phobos uninitializedAlloc

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Dec 12 02:46:31 PST 2014


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

          Issue ID: 13859
           Summary: Phobos uninitializedAlloc
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

I suggest to add to Phobos a simple function like this one:


T* uninitializedAlloc(T)() pure nothrow @trusted {
    return cast(T*)GC.malloc(T.sizeof);
}


Such function can also take a little care for the presence of internal pointers
to better tell the GC about their absence or presence.

--


More information about the Digitalmars-d-bugs mailing list