Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26764 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39238 invoked by uid 1010); 2 Dec 2006 20:30:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39222 invoked from network); 2 Dec 2006 20:30:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2006 20:30:25 -0000 Received: from [127.0.0.1] ([127.0.0.1:1255]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 85/A1-27055-162E1754 for ; Sat, 02 Dec 2006 15:30:25 -0500 X-Host-Fingerprint: 195.242.16.1 spb-1-1.dialup.peterlink.ru Received: from [195.242.16.1] ([195.242.16.1:23764] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/61-27055-84DD1754 for ; Sat, 02 Dec 2006 15:09:15 -0500 To: internals@lists.php.net Date: Sat, 02 Dec 2006 23:07:46 +0300 Organization: Milk Farm Software, ltd. Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable Message-ID: User-Agent: Opera Mail/9.02 (MacPPC) X-Posted-By: 195.242.16.1 Subject: persistent memory management From: indeyets@gmail.com ("Alexey Zakhlestin") Hi. I am trying to make my first php extension :) I am sorry, if the question would be too newbiesh, but I just couldn't = find a more correct place to ask here is the code: http://loccache.googlecode.com/svn/trunk/loccache.c I am trying to do the following: at the minit-phase I am allocating a persistent HashTable extension has 4 funcitons: * loc_set($namespace, $varname, $value); // stores $value * loc_get($namespace, $varname) // returns $value from storage * loc_isset($namespace, $varname) // returns bool * loc_unset($namespace, $varname) // removes varname from storage during loc_set, I chech if there is "$namespace" item in my persistent = hashtable, and if there isn't, I create it as a child hashtable $varname is a key in that second HashTable and $value is the value something like: $big_persistent_hash =3D array( $namespace =3D> array( $varname =3D> $value ) ); extension build and even tends to work... kinda.. unfortunately, persistent values are not too persistent in my case, and = i = keep getting memory errors. I would be grateful for any help. the source code is not too big :)