Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79515 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27920 invoked from network); 9 Dec 2014 19:51:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2014 19:51:52 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:60203] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/83-09154-7D257845 for ; Tue, 09 Dec 2014 14:51:52 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 2F4482400DF; Tue, 9 Dec 2014 14:51:49 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GT9_kW-qZlev; Tue, 9 Dec 2014 14:51:48 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 55FD02400C2; Tue, 9 Dec 2014 14:51:47 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <54875152.3060808@mabe.berlin> Date: Tue, 9 Dec 2014 19:51:46 +0000 Cc: Sara Golemon , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <54874642.6080508@mabe.berlin> <54875152.3060808@mabe.berlin> To: Marc Bennewitz X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] persistent zval From: ajf@ajf.me (Andrea Faulds) > On 9 Dec 2014, at 19:45, Marc Bennewitz wrote: >=20 >=20 > Am 09.12.2014 um 20:03 schrieb Sara Golemon: >> On Tue, Dec 9, 2014 at 10:58 AM, Marc Bennewitz = wrote: >>> Is it possible to make a zval persistent? >>>=20 >> Nope. >>=20 > Why? >=20 > 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. >=20 > Example: > persist_set($key, $value); > persist_get($key); > persist_has($key); > persist_list(); // list of persistent values No, no the GC couldn=E2=80=99t. All zval data is stored in = non-persistent memory allocated with emalloc(). The allocator destroys = all of that at the end of the request/script execution. So you=E2=80=99d = now have a dangling pointer. Kabewm! -- Andrea Faulds http://ajf.me/