John Lim wrote:
"Andrey Hristov" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
G usually comes from Globals and I have seen BG in ext/standard
so maybe BG means Basic functions Globals.
andrey
John Lim wrote:
Andi,
Just a few quick questions. What is the BG macro for? Eg.
if (zend_call_function(&fci, &BG(fci_cache) TSRMLS_CC) == SUCCESS)
Thanks for the info. I get a error with the following (BG is undefined
function):
if (zend_call_function(&fci, &BG(fci_cache) TSRMLS_CC) == SUCCESS)
So I tested with
if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS)
and it works fine.
So do i need to use BG(), and how do i so ?
So, you write your own extension, right? In this case BG is not defined since it
is defined
only for functions in ext/standard. However there is such macro already created for
your
extension (if you have used ext_skel script). You can find it in php_yourextname.h .
You should use it to have your extension be thread safe when accessing globals
variables
of your extension. This is the case in multithreaded environment where you have the
call cache as global variable but multiple threads will to use it, so YOUREXTG()
prevents
from corruption.
hope this helps,
andrey
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php