Re: Patch for macros for tracking refcount and is_ref
| From: | Nuno Lopes | Date: | Tue, 04 Sep 2007 15:26:13 +0000 |
| Subject: | Re: Patch for macros for tracking refcount and is_ref | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-32036@lists.php.net to get a copy of this message | ||
I think this is a pretty good idea. It can also have some use if we decide to investigate the usage of an off-the-shelf (conservative) garbage collector such as Boehm's (maybe in next year's SoC).
About the patch, the zval_*_p() functions don't really need to exist.. they can be macros as well. (and the online keyword is also handled by the Zend engine)
Nuno
Hi, This is another shot at a patch to manage refcount and is_ref of zvals with macros. The macros are implemented with inline functions that are forcibly inlined (so they will behave the same as macros). This will make it possible to put multiple statements in each macro later on for garbage collection purposes. One thing to note is that I removed the existing ZVAL_ADDREF and ZVAL_DELREF in favor of Z_ADDREF_P and Z_DELREF_P that do the same thing. The original duo acted on zval pointers contrary to standard form for macro names. The patch is probably too large to fit as an attachment, so here's a URL: http://zoo.cs.yale.edu/~yw226/macros.diff.txt Comments?