httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiffin Gish <>
Subject Using hash tables globally ...
Date Mon, 09 Jun 2008 17:59:05 GMT
I'm trying to use a hash table to save a global cache of calculated
areas based on the request url.

The idea is that if the give area is already in the cache then I can use
its pre-calculated value, otherwise first time I do the complicated
calculation and save the results in the hash table.

In my hook_post_config() routine I have:

   SERVER_CONFIG *s_cfg = ap_get_module_config(s->module_config,
   s_cfg->hash_tilecache = apr_hash_make(pconf);
   return OK;

In my hook_translate_name() routine I save the calculations in the hash,
but the next time hook_translate_name() is called, the hash no longer
contains this/any value, it's disappeared.

What do I need to do to make this hash table persistent globally and be
updated properly within each url request?

Thanks alot in advance,

Kiffin Gish | Desktop & Services Development | TomTom | | +31 (0)
6 15529214 mobile | +31 (0) 20 757 5000 office

This e-mail message contains information which is confidential and may be privileged. It is
intended for use by the addressee only. If you are not the intended addressee, we request
that you notify the sender immediately and delete or destroy this e-mail message and any attachment(s),
without copying, saving, forwarding, disclosing or using its contents in any other way. TomTom
N.V., TomTom International BV or any other company belonging to the TomTom group of companies
will not be liable for damage relating to the communication by e-mail of data, documents or
any other information.

View raw message