Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60779 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61055 invoked from network); 7 Jun 2012 20:18:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jun 2012 20:18:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:58965] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/B9-11153-29C01DF4 for ; Thu, 07 Jun 2012 16:18:27 -0400 Received: from [192.168.2.230] (ppp-188-174-57-120.dynamic.mnet-online.de [188.174.57.120]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 1F2EA61BE2; Thu, 7 Jun 2012 22:18:23 +0200 (CEST) To: Adi Mutu Cc: Felipe Pena , PHP Developers Mailing List In-Reply-To: <1339098824.12078.YahooMailNeo@web43502.mail.sp1.yahoo.com> References: <1338926897.37775.YahooMailNeo@web43502.mail.sp1.yahoo.com> <1339095042.60350.YahooMailNeo@web43512.mail.sp1.yahoo.com> <1339098261.2665.578.camel@guybrush> <1339098824.12078.YahooMailNeo@web43502.mail.sp1.yahoo.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 07 Jun 2012 22:18:22 +0200 Message-ID: <1339100302.2665.623.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] concatenation operator From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Thu, 2012-06-07 at 12:53 -0700, Adi Mutu wrote: > Ok Johannes, thanks for the answer. I'll try to look deeper. > I basically just wanted to know what happens when you concatenate two > strings? what emalloc/efree happens. This depends. As always. As said what has to be done is one allocation for the result value ... and then the zval magic, which depends on refcount, references, ... > Also can you tell me if possible how to put a breakpoint to > emalloc/efree which are executed only after all core functions are > registered? because it takes like a million years like this and a > million F8 presses... Depends on your debugger. Most allow conditional breakpoints or have a breakpoint and while holding at some place add a few more ... For such a question my preference is using DTrace (on Solaris, Mac or BSD), something like this session: $ cat test.d #!/sbin/dtrace pid$target::concat_function:entry { self->in_concat = 1; } pid$target::execute:return { self->in_concat = 0; } pid$target::_emalloc:entry / self->in_concat / { trace(arg0); ustack(); } pid$target::_erealloc:entry / self->in_concat / { trace(arg0); trace(arg1); ustack(); } $ cat test1.php