http://d.puremagic.com/issues/show_bug.cgi?id=2936

           Summary: std.regex.match() short string optimization
           Product: D
           Version: 2.029
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: performance
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: bugzi...@digitalmars.com
        ReportedBy: dsim...@yahoo.com


The following example program leaks memory like a sieve (because the GC is
disabled).  Apparently, std.regex.match() is not supposed to perform heap
allocations.

import std.regex, core.memory;

void main() {
    string s = "This is only a test.  Repeat, this is only a test.";
    auto r = regex("is.only");

    GC.disable;
    while(true) {
        auto m = match(s, r);
    }
}


-- 

Reply via email to