previousupnext

4.5 Exception Handling

When LeapHeap initialises it performs checking of the user-specified parameters in the registry (see section 6 The Registry Interface). The application is halted if the user parameters are malformed or inconsistent, or if the system cannot provide the quantity of address range called for. In this event, a diagnostic is written back into the registry.

During operation, Leapheap is more forgiving, in part so that applications that make the occasional rogue call but manage to stagger on can still be run. LeapHeap routines do not validate their parameters, nor does LeapHeap provide 'debugging' facilities. Application failures such as the freeing of an already-free cell will silently corrupt the heap.

LeapHeap is not capable of raising exceptions in the Windows NT structured exception handling framework, which is an option for native NT heaps. LeapHeap relies on the application to check the return values of heap routines. However it is still possible for an exception to be raised by the relict heap when an application runs with Leapheap, and that is what is likely to happen if a junk address is passed to a LeapHeap routine.