[Gecode] Memory management, where to alloc?
tack at ps.uni-sb.de
Fri Jun 18 13:00:16 CEST 2004
I'm trying to understand the whole memory management issue better. I'm at the
moment reimplementing the selection constraints, based on Christian's idea to
use a list rather than an array to store the variables (similar to his
I'm considering three alternatives:
1) Use Memory::malloc, as in IdxValMap (element constraint), consider the list
just a cache and recreate it each time the propagator is copied
2) Use Space::alloc, with the list as the only data structure
3) Use FreeList, with the list as the only data structure
I think we just have to consider 2 and 3, as 1 would effectively double the
space needed for the variables.
As the lists only shrink, 2 might be ok.
3 would let us reclaim the memory a little more dynamically, I guess.
Are there any drawbacks with the free list managed things? If not, I'd go for
that, I think.
More information about the gecode-users