Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49832 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55507 invoked from network); 1 Oct 2010 01:06:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Oct 2010 01:06:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.163 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.163 smtp163.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.163] ([67.192.241.163:38110] helo=smtp163.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/A5-18648-D1435AC4 for ; Thu, 30 Sep 2010 21:06:38 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp16.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 5334240D61; Thu, 30 Sep 2010 21:06:35 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp16.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 1BC94406BA; Thu, 30 Sep 2010 21:06:35 -0400 (EDT) Message-ID: <4CA5341A.3000102@sugarcrm.com> Date: Thu, 30 Sep 2010 18:06:34 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Jeff Brown CC: "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Understanding the benefits of handling Bucket data in PHP's HashTables From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! The bucket can store 2 types of data - either any random piece of data (ARPD) or a pointer. When bucket with ARPD is created/deleted, the memory storing ARPD is allocated/freed. When bucket holding a pointer is created/freed, nothing special happens since the pointer is stored inside the bucket. zend_hash_find returns the pointer to the data stored, not the copy of it (since you might want to modify it), that's the reason why it's void** - it's pointer to the data, which is by itself either pointer passed to hash or pointer to allocated piece for ARPD. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227