Re: duplicate string, no dupe, ?

From: Date: Fri, 18 Oct 2002 23:31:00 +0000
Subject: Re: duplicate string, no dupe, ?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-89728@lists.php.net to get a copy of this message
On Fri, 18 Oct 2002, Rasmus Lerdorf wrote: > 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? Never mind, I had made a dumb mistake in my test code. This approach does work. -Rasmus

« previous php.dev (#89728) next »