Date: 12/26/00
- Next message: ocomte <email protected>: "[PHP-DEV] PHP 4.0 Bug #8428: continue doesn't pass thru a switch statement"
- Previous message: pkalliok <email protected>: "[PHP-DEV] PHP 4.0 Bug #8427: Unwanted references"
- In reply to: Huajie Liu: "[PHP-DEV] Help on ZVAL (array) memory management"
- Next in thread: Huajie Liu: "RE: [PHP-DEV] Help on ZVAL (array) memory management"
- Reply: Huajie Liu: "RE: [PHP-DEV] Help on ZVAL (array) memory management"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi
On Tue, Dec 26, 2000 at 12:38:46PM -0500, Huajie Liu wrote:
> Hi all,
> I am writing a C extension for PHP using zend API. But I got
> serious memory leak problem. They seems related to freeing
> zval hashtable. The following is a snippet of my code:
>
> MAKE_STD_ZVAL (myzval);
> if (array_init (myzval) == FAILURE)
> {
> }
> ZEND_SET_SYMBOL (myzval->value.ht, key, zarray);
>
>
> Can anyone give me some pointer on when and how to release
> the memory allocated? It will be hihgly appreciated if
Not sure what to say to when, except that you should free
all memory you allocate before returning from the function,
unless it belongs to the data you are returning.
I think all you need to do is
zval_dtor(myzval);
> you can also point me some documents I can read through.
Personally I mostly look at code that does similar things to what
I want to do and look at the Zend source. The documentation at
http://www.zend.com/apidoc/ might be of some help too.
Stig
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: ocomte <email protected>: "[PHP-DEV] PHP 4.0 Bug #8428: continue doesn't pass thru a switch statement"
- Previous message: pkalliok <email protected>: "[PHP-DEV] PHP 4.0 Bug #8427: Unwanted references"
- In reply to: Huajie Liu: "[PHP-DEV] Help on ZVAL (array) memory management"
- Next in thread: Huajie Liu: "RE: [PHP-DEV] Help on ZVAL (array) memory management"
- Reply: Huajie Liu: "RE: [PHP-DEV] Help on ZVAL (array) memory management"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

