From e3ead6e7bb658a7a1f5a1b84002798801bc4d7de Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 2 Oct 2007 13:39:24 +0000 Subject: no excessive memory use --- it_debug.class | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'it_debug.class') 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); -- cgit v1.2.3