Re: memory allocation issues

From: Date: Tue, 21 Oct 2003 15:03:22 +0000
Subject: Re: memory allocation issues
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22875@lists.php.net to get a copy of this message
Hi Alan, Alan Knowles wrote:
This is a good point.. - should debug_backtrace be called all the time... Since dataobjects raises an error when it finishes each fetch.. It would get called alot.. if you are doing multiple queries.. Would it be better to disable backtracing by default, and turn it on using? PEAR::setDebugBacktrace(1); or something.. Thoughts????
Backtracing is the most expensive operation in PEAR_Error, time-wise. It would be wise to move it out of the constructor and into PEAR::raiseError() and PEAR::throwError(). Making it optional is a good idea, as it is only used for finding bugs. I would rather call the new function PEAR::setExtremeDebug(), so that when users have problems, they can turn it on to get detailed information. Very rarely is the debug_backtrace() actually needed for any error, as most errors simply have nothing to do with the code that raises them. I'm also looking at some other changes to PEAR_Error once 4.3.4 comes out, I'd be happy to take care of this problem. Greg

« previous php.pear.dev (#22875) next »