Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79576 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74160 invoked from network); 11 Dec 2014 18:46:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2014 18:46:49 -0000 Authentication-Results: pb1.pair.com header.from=dev@mabe.berlin; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dev@mabe.berlin; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mabe.berlin from 80.237.132.167 cause and error) X-PHP-List-Original-Sender: dev@mabe.berlin X-Host-Fingerprint: 80.237.132.167 wp160.webpack.hosteurope.de Received: from [80.237.132.167] ([80.237.132.167:46664] helo=wp160.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/C1-58820-796E9845 for ; Thu, 11 Dec 2014 13:46:48 -0500 Received: from dslc-082-082-189-207.pools.arcor-ip.net ([82.82.189.207] helo=[192.168.178.30]); authenticated by wp160.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) id 1Xz8lA-0002Ob-H5; Thu, 11 Dec 2014 19:46:44 +0100 Message-ID: <5489E693.1040605@mabe.berlin> Date: Thu, 11 Dec 2014 19:46:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Stanislav Malyshev , Sara Golemon CC: PHP internals References: <54874642.6080508@mabe.berlin> <54875152.3060808@mabe.berlin> <54880A15.50908@gmail.com> In-Reply-To: <54880A15.50908@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;dev@mabe.berlin;1418323608;4539dce9; Subject: Re: [PHP-DEV] persistent zval From: dev@mabe.berlin (Marc Bennewitz) Am 10.12.2014 um 09:53 schrieb Stanislav Malyshev: > 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. > Thanks for the explanation! I'll experiment with it for scalars as extension. Marc