duplicate string, no dupe, ?
| From: | Rasmus Lerdorf | Date: | Fri, 18 Oct 2002 23:18:26 +0000 |
| Subject: | duplicate string, no dupe, ? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-89727@lists.php.net to get a copy of this message | ||
I'm trying to optimize some code for an *extremely* busy site. This site
has a bunch of data in shared memory to make it available across all the
httpd's. I need to provide this data in the form of arrays to user-space
PHP through an extension obviously. Rather trivial to do, but my problem
is that I need to estrndup() this stuff to make PHP happy. This is
slowing me down. If I don't dupe the data then PHP will try to efree() it
which is a no-no since this is an external pointer.
Instead of a normal array_init(return_value) could I zend_hash_init() my
own hash and still set it to be an array but provide my own DTOR function
which will not free these pointers?
-Rasmus