[Issue 13544] New: calls to std.file.FileException are idup-ing their string arguments
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Sep 27 13:22:27 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13544
Issue ID: 13544
Summary: calls to std.file.FileException are idup-ing their
string arguments
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
The signature for functions like std.file.copy() takes "in char[]" so it can
be called with both mutable and immutable strings. If an exception gets
thrown, the conservative assumption is that the source may get changed
so the string is duplicated.
The problem, again, is bloat.
The solution is to add two overloads for FileException, one taking string and
one taking const(char)[].
--
More information about the Digitalmars-d-bugs
mailing list