[Issue 2936] New: std.regex.match() short string optimization
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon May 4 19:39:09 PDT 2009
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: bugzilla at digitalmars.com
ReportedBy: dsimcha at 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);
}
}
--
More information about the Digitalmars-d-bugs
mailing list