diff options
author | Urban Müller | 2007-10-02 13:39:24 +0000 |
---|---|---|
committer | Urban Müller | 2007-10-02 13:39:24 +0000 |
commit | e3ead6e7bb658a7a1f5a1b84002798801bc4d7de (patch) | |
tree | 74e15e4f575b55fe2c9aaf7445082e928de8f445 /it_debug.class | |
parent | caacf25cfe3e5e6c233a7f7cbc7accb9600a24b1 (diff) | |
download | itools-e3ead6e7bb658a7a1f5a1b84002798801bc4d7de.tar.gz itools-e3ead6e7bb658a7a1f5a1b84002798801bc4d7de.tar.bz2 itools-e3ead6e7bb658a7a1f5a1b84002798801bc4d7de.zip |
no excessive memory use
Diffstat (limited to 'it_debug.class')
-rw-r--r-- | it_debug.class | 9 |
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); |