Re: [APC-DEV] refcount/is_ref commit

From: Date: Fri, 29 Dec 2006 09:43:50 +0000
Subject: Re: [APC-DEV] refcount/is_ref commit
References: 1 2  Groups: php.apc.dev 
Request: Send a blank email to php-apc-dev+get-39@lists.php.net to get a copy of this message
Brian Shire wrote:
+    (*dst)->refcount = (*src)->refcount;
+    (*dst)->is_ref = (*src)->is_ref;
...
I don't believe we should have an APC shared memory leak, but that's something I should verify.
<?php $a = array("hello !"); $b = &$a; $c = &$a; debug_zval_dump($c[0]); apc_store('foozbar', $c[0]); ?> Not quite sure it leaks, but it still gives an invalid refcount into shm land. The original refcount reset came from a bit of similar code.
Wonder if the preferred solution is something more along the lines of (saying this without testing it out *too* much): ...
+    } else {
+        (*dst)->refcount = 1;
     }
Yes, that might work. But I still feel the need to simplify all this code, trying to avoid the hash lookup in the copy *out* of cache and probably revert a bit of code (especially the semantics of free_ vs destroy_).
"If I learn from my mistakes, pretty soon I'll know everything." :-)
:D Cheers, Gopal --

« previous php.apc.dev (#39) next »