STR-168: Implement garbage collection of hashtables and set.
A destructor can be attached to a blob representation of a hashtable pointer. This descructor can destroy a hashtable automatically. The destroy functions should become obsolete to prevent duplicate destruction.
Submitted on 6 September 2004 at 09:39
Issue Log
STR-168, martin:
Cool to have, but requires more work. Moved to 0.13
STR-168, martin:
This requires a careful implementation:1) A single, global, deconstructor will be used. This deconstructor should check if the blob is a set or hashtable (since there can also be other blobs). This should be based on a Set, since we can reserve a specific blob structure for hashtable or sets.
2) The blob might already be destroyed by hand, so destroy needs to be changed to remove the blob from the set of blobs that have to deconstructed. In the mean-time, the deconstructor should not be applied.
3) Destruction by hand should always be done using the single destruction primitive.
STR-168, martin:
ATerm destructors are not per term.
STR-168, martin:
This getting more and more important. We need to find a solution.
STR-168, martin:
A possible solution could be to make every blob a composition of two pointers: the actual pointer and the blob specific desctructor, a function pointer.This would allow a single, global, blob destructor that can invoke the blob specific destructors.
STR-168, pierron:
There is a patch for the ATerm library to handle destructor with the blob declaration.http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=651
which provide the following function (macro):
ATmakeDestructableBlob(size, data, dtor)By the way, this patch will also solve the limited number of destructor that can be registered in the ATerm library.
Log in to post comments