Allocation failures

thedeemon via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 16 22:52:21 PST 2016


On Tuesday, 16 February 2016 at 17:15:17 UTC, Jardík wrote:
> But if I couldn't use GC and do all allocations and 
> deallocations manually, I wouldn't even be able to use 
> exceptions and there would also no longer be much reason to 
> write it in D.

I'd say if you're going to grow GC heap so big it doesn't fit in 
memory it's a bad idea in the first place, since each GC cycle 
will take a lot of time, like, a lot. It might also leak. In a 
32-bit process it will leak almost for sure.
So keep GC heap for small litter (including exceptions) and use 
other allocators for large pieces of data. This way you may get 
best of what D offers without long-GC-pause or 
out-of-memory-termination pains.



More information about the Digitalmars-d mailing list