Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1966 (new defect)

Opened 14 years ago

Assert exception should not allocate

Reported by: llucax Assigned to: community
Priority: minor Milestone: 1.0
Component: Runtime Version: 0.99.9 Kai
Keywords: Cc: llucax

Description

This bug applies to Tango too: http://d.puremagic.com/issues/show_bug.cgi?id=4587

Copied for convenience:

If an assert error allocates memory, the GC allocation code can't use assert, because it enters in an infinite recursion if the assertion fail.

Since OutOfMemory? don't allocate, I think a similar trick can be done for assert. Is not too bad the current situation, because it only affects the GC, but it would be nice to be able to use assert inside the GC without having to be very careful that the assert is not used in the code path for allocation (which includes the collection itself).