www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13859] New: Phobos uninitializedAlloc

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 puremagic.com
          Reporter: bearophile_hugs 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.

--
Dec 12 2014