Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26770 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74843 invoked by uid 1010); 3 Dec 2006 10:13:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74828 invoked from network); 3 Dec 2006 10:13:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Dec 2006 10:13:19 -0000 Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 209.142.136.51 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.142.136.51 neville-out.centurytel.net Linux 2.5 (sometimes 2.4) (4) Received: from [209.142.136.51] ([209.142.136.51:40290] helo=neville-out.centurytel.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/60-04825-9F2A2754 for ; Sun, 03 Dec 2006 05:12:44 -0500 Received: from msa2-mx.centurytel.net (msa2-mx.centurytel.net [209.142.136.132]) by neville-out.centurytel.net (Postfix) with ESMTP id 818CDFD68D for ; Sun, 3 Dec 2006 03:54:15 -0600 (CST) Received: from pc1 (d8-162.rt-bras.wnvl.centurytel.net [69.179.135.162]) by msa2-mx.centurytel.net (8.13.6/8.13.6) with SMTP id kB39nF11001118; Sun, 3 Dec 2006 03:49:15 -0600 Message-ID: <006601c716c0$4bf185c0$0201a8c0@pc1> To: , "Alexey Zakhlestin" References: Date: Sun, 3 Dec 2006 03:49:15 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Subject: Re: [PHP-DEV] persistent memory management From: php_lists@realplain.com ("Matt Wilmas") Hi Alexey, Not sure what the exact problem is, or if this is related, but in your loc_set() function's zend_hash_add() calls, you have sizeof(HashTable) and sizeof(zval). Shouldn't both of those be sizeof(HashTable *) ? :-) Matt ----- Original Message ----- From: "Alexey Zakhlestin" Sent: Saturday, December 02, 2006 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 = array( $namespace => array( $varname => $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 :)