make range allocation dynamic

This is a test fix after commit

5cbe8d07fb

to see what can be done. Truth is that not much. I could fix how
ranges are allocated, but the fact there is pointers to shared
networks and network names reallocating the memory spaces is not
really going to work. The only way to truly fix this issue is to
create better data structures. As you can expect that is a major
change, and will take some time to implement.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-04-10 19:12:29 +02:00
parent f6880ed5f4
commit b492802dfa
6 changed files with 33 additions and 17 deletions

View file

@ -213,6 +213,7 @@ int main(int argc, char **argv)
/* Global allocations, counter resets etc */
int prepare_memory()
{
RANGES = 64;
num_ranges = num_shared_networks = 0;
shared_networks =
safe_malloc(sizeof(struct shared_network_t) * SHARED_NETWORKS);