Re: IS_INTERNED for apc + zend mixtures
| From: | Gopal V | Date: | Thu, 28 Jul 2011 19:53:14 +0000 |
| Subject: | Re: IS_INTERNED for apc + zend mixtures | ||
| References: | 1 2 | Groups: | php.apc.dev |
| Request: | Send a blank email to php-apc-dev+get-284@lists.php.net to get a copy of this message | ||
On Thursday 28 July 2011 12:48 AM, Dmitry Stogov wrote:
O+ uses single SHM memory block to keep all the interned strings.I like the simplicity of the IS_INTERNED check. It's simple & it's fast.
It overrides CG(interned_strings_start) and CG(interned_strings_end) with SHM memory block boundaries. It also overrides zend_new_interned_string, zend_interned_strings_snapshot and zend_interned_strings_restore with dummy functions so PHP doesn't create interned strings itself.The issue I faced was with strings which would be interned *before* apc MINIT. So once apc overrides the CG(interned_strings_start), the old strings are double-free'd. I'm guessing that it's fixed by ensuring memory cleanup order instead of ensuring IS_INTERNED() checks both blocks (apc and the zend one). Cheers, Gopal