Re: IS_INTERNED for apc + zend mixtures
| From: | Dmitry Stogov | Date: | Fri, 29 Jul 2011 19:30:56 +0000 |
| Subject: | Re: IS_INTERNED for apc + zend mixtures | ||
| References: | 1 2 3 | Groups: | php.apc.dev |
| Request: | Send a blank email to php-apc-dev+get-286@lists.php.net to get a copy of this message | ||
On 07/28/2011 11:53 PM, Gopal V wrote:
On Thursday 28 July 2011 12:48 AM, Dmitry Stogov wrote:I hope, you already saw my patch that fixes the problem. As I explained after the initial interned string patch for PHP and APC I did additional improvement in PHP, but didn't make corresponding tweak in APC.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).it's logically wrong, because you allow the same string to be stored twice in both regions. Anyway, please ask me if you are not sure how some new features works. (I know we don't document ZE internals and it's often very hard to understand it). I'm not always able to respond immediately and provide a solution, but I'll try to help. I'll also always glad to hear any ideas how to make PHP faster (even if I do't accept some of them). Thanks. Dmitry.
Cheers, Gopal