Hi!

> Why?
> 
> There is a reference counter, which should be increased on put a value
> into persistence and on removing a value from persistence decrease it.
> So the GC could handle unreferenced zvals.

Because memory which is allocated by the engine is freed at the end of
the request. You could copy the memory values but by then unless your
zvals are pretty simple you'll be pretty close to what the serializer
does, so no really big win there. The only advantage would be that when
you use it, if you're really careful, then you can use the data without
reallocating memory and freeing it. But it's not just putting a
flag/refcount on it, it requires some copying before that and some
careful setting of the refcounts too. So in theory, it can be done at
least for scalars and arrays (objects would be a problem since they need
class, and what if the class changed?) but it's not trivial.

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to