Useful to implement recycling support in libraries.
Has no sense for expanded types (it will not even compile).
This class is designed to work with and without the garbage collector. It takes advantage of the GC if
it is used, but it also minimises the memory footprint when the GC is not used.
Automatically calls the "recycle" feature of the object.
Two notes:
You should not directly reuse the object after it is recycled; call item instead to obtain a
fresh reference. Using it directly will lead to classic problems of double referencing. In a
nutshell, be sure not to hold any reference to a recycled object.
If the GC is used it may free some recycled objects so using a RECYCLING_POOL does not interfere
with memory conservation.
For performance reasons, the unused area of storage is always left as it is when
some elements are removed.
No time is lost to clean the released area with a Void
or a 0 value. (Look for example the remove_last implementation.)
Thus, the unused area of storage may contains references of actually unreachable
objects. The following mark_native_arrays actually replace the
default behavior (the call is automatic) in order to mark only reachable objects.
The basic = is used
for comparison of items and indices are not considered (for
example this routine may yield True with Current indexed in
range [1..2] and other indexed in range [2..3]).
Forces the garbage collector to continue the marking process on the index-th element of
the native_array. The element at index can be Void or not Void (the Void-ness test
performed inside the mark_item itself).