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.

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...

Thanks.


________________________________
 From: Johannes Schlüter <johan...@schlueters.de>
To: Adi Mutu <adi_mut...@yahoo.com> 
Cc: Felipe Pena <felipe...@gmail.com>; PHP Developers Mailing List 
<internals@lists.php.net> 
Sent: Thursday, June 7, 2012 10:44 PM
Subject: Re: [PHP-DEV] concatenation operator
 
On Thu, 2012-06-07 at 11:50 -0700, Adi Mutu wrote:
> 
> that's nice, but i haven't understood a thing...i know something about
> php core and php extensions, but nothing about the Zend engine
> specific. 

The mentioned place is directly in the VM, which in general is harder to
understand, but well, it directs to the "concat_function" on
http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_operators.c#1234

Knowing basic C should be enough to understand the code there. The
actual "algorithm" can also easily be guessed (allocate a buffer which
can hold both strings at once and copy them over,the code is a tiny bit
more complex as it tries tore use an existing buffer than allocating
something completely new)

The question is: What do you actually want to know?

> Can you point me to some resources on this topic?

Unfortunately not. The source is the best documentation we have for
that.

johannes



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to