diff options
author | Zeev Suraski <zeev@php.net> | 1999-05-20 19:06:28 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-05-20 19:06:28 +0000 |
commit | 59a539f6ad696a53e4358fdfc36ac4965dcbc989 (patch) | |
tree | ead578e1fee048d94c9cbb3a80025ff79debb8b2 /main | |
parent | 27fc61c4dc81f422cb9b72e4d144213ef6ba8d3c (diff) | |
download | php-git-59a539f6ad696a53e4358fdfc36ac4965dcbc989.tar.gz |
Use OutputDebugString() or fprintf(stderr,) for memory leaks
Diffstat (limited to 'main')
-rw-r--r-- | main/main.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/main/main.c b/main/main.c index ebe1953877..25ecda6381 100644 --- a/main/main.c +++ b/main/main.c @@ -576,17 +576,13 @@ static void php_message_handler_for_zend(long message, void *data) if (EG(error_reporting)&E_WARNING) { #if ZEND_DEBUG mem_header *t = (mem_header *) data; -# if APACHE /* log into the errorlog, since at this time we can't send messages to the browser */ char memory_leak_buf[512]; - snprintf(memory_leak_buf,512,"Possible PHP4 memory leak detected (harmless): 0x%0.8lX, %d bytes from %s:%d", (long) t, t->size, t->filename, t->lineno); -# if MODULE_MAGIC_NUMBER >= 19970831 - aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, ((request_rec *) SG(server_context))->server, memory_leak_buf); -# else - log_error(memory_leak_buf, ((request_rec *) SG(server_context))->server); -# endif + snprintf(memory_leak_buf, 512, "Freeing 0x%0.8X (%d bytes), allocated in %s on line %d<br>\n",(void *)((char *)t+sizeof(mem_header)+PLATFORM_PADDING),t->size,t->filename,t->lineno); +# if WIN32||WINNT + OutputDebugString(memory_leak_buf); # else - php3_printf("Freeing 0x%0.8X (%d bytes), allocated in %s on line %d<br>\n",(void *)((char *)t+sizeof(mem_header)+PLATFORM_PADDING),t->size,t->filename,t->lineno); + fprintf(stderr, memory_leak_buf); # endif #endif } |