Bug 2936 – std.regex.match() short string optimization

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-05-04T21:39:00Z
Last change time
2015-06-09T01:26:26Z
Keywords
performance
Assigned to
dmitry.olsh
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2009-05-04T21:39:19Z
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); } }
Comment #1 by andrei — 2011-06-05T07:51:13Z
Reassigning to Dmitry.
Comment #2 by dmitry.olsh — 2011-12-09T11:45:53Z
Fixed in new std.regex