take a look at the RETURN_STRING[L] macro. the last argument determines
whether the string passed to it is duplicated by PHP before returning it to the user.
But if you return and duplicate, you have no chance to free() the original string, no?
Ah, I see your confusion. Do this:
RETVAL_STRINGL(str, strlen, 1); free(str);
The trick is that the RETVAL_* macros simply fill in the magic return_value zval whereas the RETURN_* macros return straight away.
-Rasmus
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php