apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunter Coelle <gunter.coe...@dbaudio.com>
Subject Iterating with apr_hash_first / memory probs
Date Wed, 16 Apr 2003 06:48:58 GMT
Hi,

I'd like to iterate over a hash table with apr_hash_first/this/next

When I get it right I can use "apr_hash_first(NULL, ht)" to take a built 
in iterator. Fine so far.

But since I have to iterate the hash table within two independant 
threads, i have to use "apr_hash_first (p, ht)" to allocate a new 
(independant) iterator.

This takes up memory on every call to apr_hash_first, and since my 
threads have to iterates through the table permanently, this leads to 
memory shortage after a while.

My opinion is, that the process of allocating an iterator (which can be 
done only once) and jumping to the first entry should be separated.

Can you give some suggestions/solutions?

Gunter


Mime
View raw message