Hello Vesselin,

Monday, August 25, 2003, 9:10:09 AM, you wrote:

VA> Hello.
VA> I compiled PHP with ccmalloc (a memory leak detector) and it reported two memory 
leaks.
VA> Here is a patch that meakes the leak reports go away. Actually only the first two
VA> allocations (GLOBAL_FUNCTION_TABLE and GLOBAL_CLASS_TABLE) are reported by 
ccmalloc,
VA> but I think that GLOBAL_CONSTANTS_TABLE is missing too.

VA> vesselin

VA> diff -ruN php5-200308250130.orig/Zend/zend.c php5-200308250130/Zend/zend.c
VA> --- php5-200308250130.orig/Zend/zend.c  2003-08-24 14:07:14.000000000 +0000
VA> +++ php5-200308250130/Zend/zend.c       2003-08-25 08:13:52.000000000 +0000
VA> @@ -685,7 +685,9 @@
VA>         zend_destroy_rsrc_list_dtors();
 
VA>         zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
VA> +       free(GLOBAL_FUNCTION_TABLE);
VA>         zend_hash_destroy(GLOBAL_CLASS_TABLE);
VA> +       free(GLOBAL_CLASS_TABLE);
 
VA>         zend_hash_destroy(GLOBAL_AUTO_GLOBALS_TABLE);
VA>         free(GLOBAL_AUTO_GLOBALS_TABLE);
VA> @@ -695,6 +697,7 @@
VA>         zend_shutdown_constants(TSRMLS_C);
VA>  #ifdef ZTS
VA>         zend_hash_destroy(GLOBAL_CONSTANTS_TABLE);
VA> +       free(GLOBAL_CONSTANTS_TABLE);
VA>         unregister_standard_class();
VA>  #endif
VA>  }


Then you don't use ZTS mode. Please configure your php build in ZTS mode and
try again. (--enable-maintainer-zts and/or one of the threading models like
--with-tsrm-pthreads).

-- 
Best regards,
 Marcus                            mailto:[EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to