Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10721 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58380 invoked by uid 1010); 23 Jun 2004 10:41:14 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58356 invoked from network); 23 Jun 2004 10:41:14 -0000 Received: from unknown (HELO out2.smtp.messagingengine.com) (66.111.4.26) by pb1.pair.com with SMTP; 23 Jun 2004 10:41:14 -0000 Received: from server3.messagingengine.com (server3.internal [10.202.2.134]) by mail.messagingengine.com (Postfix) with ESMTP id D0256C0C6D1 for ; Wed, 23 Jun 2004 06:41:13 -0400 (EDT) Received: by server3.messagingengine.com (Postfix, from userid 99) id 616B51714A0; Wed, 23 Jun 2004 06:41:14 -0400 (EDT) Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-Mailer: MIME::Lite 1.4 (F2.72; T1.001; A1.62; B3.01; Q3.01) To: internals@lists.php.net Date: Wed, 23 Jun 2004 02:41:14 -0800 X-Sasl-Enc: z1Mh1b7sywk2/r//eAWApw 1087987274 Message-ID: <1087987274.4429.199006408@webmail.messagingengine.com> Subject: issue in copying the hash table From: kameshj@fastmail.fm ("Kamesh Jayachandran") Hi All, I could not understand one piece of code in PHP 5.0 RC3. File Zend/zend.c function compiler_globals_ctor() Here we copy global_class_table to thread specific compiler_globals's class_table. For this we use zend_hash_copy which is a generic function used by many types. As of my knowledge our class table HashTable structure is structured as, key = char* value = zend_class_entry ** If it is the case how this zend_hash_copy will work? As I could see zend_hash_copy calls zend_hash_add_or_update with data as the bucket's pData which is void* and semantically zend_class_entry ** and memcpy of INIT_DATA macro tries to copy from whatever pData points to (zend_class_entry**) till sizeof(zend_class_entry)=292 bytes which is wrong shoudl cause seg fault ideally. Please clarify. With regards Kamesh Jayachandran