Re: Garbage Collection!

From: Date: Fri, 17 May 2002 17:56:58 +0000
Subject: Re: Garbage Collection!
References: 1  Groups: php.dev php.dev 
Request: Send a blank email to php-dev+get-84150@lists.php.net to get a copy of this message
At 08:53 PM 5/17/2002, Robert Cummings wrote:
Let's say I do:
    zval *newVar;
    MAKE_STD_ZVAL( newVar );
    ZEND_SET_SYMBOL( &EG(symbol_table), "varKey", newVar );
and then I do:
    MAKE_STD_ZVAL( newVar );
    ZEND_SET_SYMBOL( &EG(symbol_table), "varKey", newVar );
This will overwrite my orignal newVar, however, will the original newVar be garbaged collected or is this my responsibility now that I'm out of PHP land? Also if it is auto garbage collected, is there a way I can force garbage collection to run while I'm in a deep recursion?
Whatever you register into the standard data structures, EG(symbol_table) included, is taken care of by the engine. In that case, the old value will be destroyed as soon as you replace it in the 2nd SET_SYMBOL call. Zeev

« previous php.dev (#84150) next »