Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12734 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34476 invoked by uid 1010); 11 Sep 2004 11:38:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 34412 invoked from network); 11 Sep 2004 11:38:16 -0000 Received: from unknown (HELO frontend1.messagingengine.com) (66.111.4.30) by pb1.pair.com with SMTP; 11 Sep 2004 11:38:16 -0000 Received: from web1.messagingengine.com (web1.internal [10.202.2.210]) by frontend1.messagingengine.com (Postfix) with ESMTP id 7BCACC14F4A for ; Sat, 11 Sep 2004 07:38:15 -0400 (EDT) Received: by web1.messagingengine.com (Postfix, from userid 99) id D5BD7860; Sat, 11 Sep 2004 07:38:15 -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.5 (F2.73; T1.001; A1.62; B3.01; Q3.01) To: internals@lists.php.net Date: Sat, 11 Sep 2004 04:38:15 -0700 X-Sasl-Enc: fYf5yjyIEZee4AdrgFml1Q 1094902695 Message-ID: <1094902695.31156.204154130@webmail.messagingengine.com> Subject: Why zend_shutdown_constants not called from executor_globals_dtor? From: kameshj@fastmail.fm ("Kamesh Jayachandran") Hi All, I could see in executor_globals_ctor calling zend_startup_constants which allocates one hash table. Later to free this hash table zend_shutdown_constants is called from zend_shutdown rather than executor_globals_dtor. This may not cause a memory leak in Non ZTS environment where zend_shutdown and executor_globals_dtor are called only once and the current free up by calling zend_shutdown_constants from zend_shutdown won't cause any memory leak. In case of ZTS environment every thread calls executor_globals_ctor and only the main thread causes zend_shutdown and hence only main thread EG(zend_constants) are freed whereas other threads EG(zend_constants) are not freed. Correct me if I am wrong. With regards Kamesh Jayachandran