summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2007-10-02 13:39:24 +0000
committerUrban Müller2007-10-02 13:39:24 +0000
commite3ead6e7bb658a7a1f5a1b84002798801bc4d7de (patch)
tree74e15e4f575b55fe2c9aaf7445082e928de8f445
parentcaacf25cfe3e5e6c233a7f7cbc7accb9600a24b1 (diff)
downloaditools-e3ead6e7bb658a7a1f5a1b84002798801bc4d7de.tar.gz
itools-e3ead6e7bb658a7a1f5a1b84002798801bc4d7de.tar.bz2
itools-e3ead6e7bb658a7a1f5a1b84002798801bc4d7de.zip
no excessive memory use
-rw-r--r--it_debug.class9
1 files changed, 6 insertions, 3 deletions
diff --git a/it_debug.class b/it_debug.class
index e654851..79433db 100644
--- a/it_debug.class
+++ b/it_debug.class
@@ -135,10 +135,13 @@ function backtrace($skip = 0)
{
$result = array();
- foreach (array_slice(debug_backtrace(), $skip + 1) as $call)
+ if (!function_exists('memory_get_usage') || (memory_get_usage() < 50000000))
{
- if ($call['file'])
- $result[] = basename($call['file']) . ":" . $call['line'];
+ foreach (array_slice(debug_backtrace(), $skip + 1) as $call)
+ {
+ if ($call['file'])
+ $result[] = basename($call['file']) . ":" . $call['line'];
+ }
}
return join(" ", $result);