Bug 6151 – [GC] Make the GC functions weakly pure

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P4
Component
druntime
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-06-12T13:09:00Z
Last change time
2016-10-14T16:52:49Z
Assigned to
nobody
Creator
kennytm
Blocks
4850

Comments

Comment #0 by kennytm — 2011-06-12T13:09:53Z
Original discussion: * http://www.digitalmars.com/d/archives/digitalmars/D/Should_GC.malloc_be_considered_pure_137919.html * http://www.digitalmars.com/d/archives/digitalmars/D/Re_Should_GC.malloc_be_considered_pure_137984.html * http://www.digitalmars.com/d/archives/digitalmars/D/Re_Should_GC.malloc_be_considered_pure_138177.html Due to practicality, allocation is allowed in pure function. By the same token, GC.malloc should also be 'pure'. GC functions being not weakly-pure is the reason why std.conv.to (bug 4850) and std.array.appender cannot be pure. Marking the GC functions are pure are easy, but the problem is the implication behind it. Technically, GC functions depend on global states, so they cannot be weakly pure. But then std.array.appender can never become pure without sacrificing performance.
Comment #1 by alex — 2012-10-09T18:53:28Z
What we really need in order to move forward with this is a way to explicitly tell the compiler that something is weakly pure.
Comment #2 by monarchdodra — 2014-03-17T03:25:08Z
This seems solved to me. Since a couple of releases, AFAIK. Close WORKSFORME?
Comment #3 by andrei — 2016-10-14T16:52:49Z
We still have https://issues.dlang.org/show_bug.cgi?id=15862. But we can close this.