www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13055] New: nogc std.string.sformat


          Issue ID: 13055
           Summary:  nogc std.string.sformat
           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

sformat uses the given buffer, so this should compile:

void main()  nogc {
    import std.string: sformat;
    char[50] arr;
    sformat(arr, "%d", 100);

If the given buffer is not large enough, sformat throws an exception. I think
throwing this exception should not require a GC memory allocation at run-time.

Jul 06 2014