Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71127 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33759 invoked from network); 14 Jan 2014 19:38:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2014 19:38:50 -0000 Authentication-Results: pb1.pair.com header.from=chris_se@gmx.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=chris_se@gmx.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.net designates 212.227.15.18 as permitted sender) X-PHP-List-Original-Sender: chris_se@gmx.net X-Host-Fingerprint: 212.227.15.18 mout.gmx.net Received: from [212.227.15.18] ([212.227.15.18:57519] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/A6-33466-34295D25 for ; Tue, 14 Jan 2014 14:38:44 -0500 Received: from arafel.iwakd.de ([78.46.72.57]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MAkkB-1WETPY1OO3-00BriO for ; Tue, 14 Jan 2014 20:38:39 +0100 Received: from [192.168.0.150] (HSI-KBW-134-3-44-163.hsi14.kabel-badenwuerttemberg.de [134.3.44.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arafel.iwakd.de (Postfix) with ESMTPSA id CF1039230B9; Tue, 14 Jan 2014 20:38:38 +0100 (CET) Message-ID: <52D5923E.2080009@gmx.net> Date: Tue, 14 Jan 2014 20:38:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Dmitry Stogov , PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:fzWGznunJwUBWScHQekncwficEjNihwPN+p5F8jOBUvcWLyLEJG xaUoRxFRlTw/t+9b/SksG4M+CO9ssGmC4sn+5naBiSznC920KONIicC3VZXawJTk8paNr1I VFxjDB6QWjgKBEyb3wpLVLxoYcloNRGuIJoZY8d0Zb4tGOzJM8wCFnG+Tf9sWxwLSOi0yJW uovM7+GWK1DTI0kg1s3Bg== Subject: Re: [PHP-DEV] New Memory Manager From: chris_se@gmx.net (Christian Seiler) Hi there, > (For example: may be someone would > suggest how to avoid check for USE_ZEND_ALLOC=0 to allow system malloc() > usage on each emalloc() call? Rename emalloc() -> real_emalloc(), then: .h: extern void (*emalloc)(size_t n); .c: void (*emalloc)(size_t n) = real_emalloc; startup code: if (USE_ZEND_ALLOC is 0) { emalloc = malloc; } Probably some adjustments needed (esp. for potentially different calling conventions, so maybe malloc() will need a small wrapper), this is just from the top of my head. Note: this breaks ABI compatibility on most archs (because it changes the symbol type). But could be done independently of anything else. Note 2: Depending on system architecture, each call to the function may incur an additional (small) penalty. No idea how this compares to the penalty of the if() at the start of emalloc(). Regards, Christian