Re: global HashTables
| From: | l0t3k | Date: | Thu, 14 Feb 2002 19:39:54 +0000 |
| Subject: | Re: global HashTables | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-80058@lists.php.net to get a copy of this message | ||
Brad,
[snip]
/* {{{ php_test_init_globals
*/
static void php_test_init_globals(zend_test_globals *test_globals)
{
test_globals->global_hash = emalloc(sizeof(HashTable));
zend_hash_init(test_globals->global_hash, 0, NULL, delete_friggin_type, 0);
zend_hash_add(test_globals->global_hash, "mykey", strlen("mykey"),
"myvalue", strlen("myvalue"), NULL);
}
/* }}} */
[snip]
shouldnt module globals be malloc'ed as opposed to emalloc'ed. all
emalloced memory is automagically reclaimed at the end of a request.
Brad Lafountain <rodif_bl@yahoo.com> wrote in message
news:20020214190708.69579.qmail@web9607.mail.yahoo.com...
> Sorry i forgot to attach the extension
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE Valentine eCards with Yahoo! Greetings!
> http://greetings.yahoo.com