Re: FREE_ZVAL and/or zval_dtor()
| From: | Andrey Hristov | Date: | Tue, 12 Mar 2002 13:23:05 +0000 |
| Subject: | Re: FREE_ZVAL and/or zval_dtor() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-81078@lists.php.net to get a copy of this message | ||
It is my mistake. There are two macroses ZEND_FAST_FREE
#define ZEND_FAST_FREE(p, fc_type) \
{ \
TSRMLS_FETCH(); \
\
((zend_fast_cache_list_entry *) (p))->next = (zend_fast_cache_list_entry *)
AG(fast_cache_list_head)[fc_type]; \
AG(fast_cache_list_head)[fc_type] = (zend_fast_cache_list_entry *) (p); \
}
and
#define ZEND_FAST_FREE(p, fc_type) \
efree(p)
Depends on that is ZEND_ENABLE_FAST_CACHE is on.
The first one is not freeing any memory the second one is.
Regards,
Andrey
----- Original Message -----
From: "Klaus Reimer" <k@ailis.de>
To: "Andrey Hristov" <ahristov@icygen.com>
Cc: <php-dev@lists.php.net>
Sent: Tuesday, March 12, 2002 3:07 PM
Subject: Re: [PHP-DEV] FREE_ZVAL and/or zval_dtor()
> Hi,
>
> On Tuesday 12 March 2002 14:01, Andrey Hristov wrote:
> > As far as I see FREE_ZVAL is ZEND_FAST_FREE and the latter is not freeing
> > memory just removes the zval from a list. So it is required to release the
> > memory before that. Fix me if I'm wrong.
>
> FREE_ZVAL calls ZEND_FAST_FREE, that's correct. But ZEND_FAST_FREE does call
> efree(). So I'm pretty sure, thtat FREE_ZVAL does release the memory of the
> zval, which has been allocated by using MAKE_STD_ZVAL (which calls ALLOC_ZVAL
> which calls ZVAL_FAST_ALLOC which calls emalloc()).
>
> --
> Bye, K <http://www.ailis.de/~k/>
> [A735 47EC D87B 1F15 C1E9 53D3 AA03 6173 A723 E391]
> (Finger k@ailis.de to get public key)
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>