CBFalconer wrote:
Frank Heckenbach wrote:
... snip ...
It's a kludge. I think it would work, but I wouldn't like to keep it permanently ... ;-)
You could arrange that the standard procedure new returns NIL for failure, and that the compiler generates all calls with a following "if p = NIL THEN trap;". This would duplicate the standard specified action, but allow for a compile time switch (or pseudo comment) to inhibit the trap action generation. Then the user can install whatever action he desires.
OTOH, it produces more runtime code.
It also makes it easy for the normal trap action to report file:linenumber data.
Yes, but we can also get this information via a backtrace and addr2line, so that's not the most important thing.
Frank