On Wed, 14 May 2014 22:42:46 +0000 Brian Schott via Digitalmars-d <[email protected]> wrote:
> What is the plan for the "pure"-ity of memory management? > > Right now the "new" operator is considered to be pure even though > it is not, but related functinos like malloc, GC.addRange, > GC.removeRange, and others are not. > > This prevents large portions of std.allocator from being pure. > This then prevents any containers library built on std.allocator > from being pure, which does the same for any funcions and data > structures written using those containers. > > If malloc can never be considered pure, even when hidden behind > an allocator, why can it be considered pure when hidden behind > the GC? I think malloc should definitely be considered pure for the same reasons that new is considered pure. I don't know about the other memory management functions though. I'd really have to think through their side effects to have an opinion on them. If we can make them pure though, that would certainly help with ensuring that allocators can be pure. - Jonathan M Davis
