"Little Scheme" and PL Design (Code Critique?)

Jack Pope zedlan at invec.net
Sat Nov 19 19:16:41 UTC 2022


On Thursday, 17 November 2022 at 22:05:45 UTC, jwatson-CO-edu 
wrote:
> [`Atom`](https://github.com/jwatson-CO-edu/SPARROW/blob/main/lil_schemer.d#L66) (unit of data), I throw it on the heap and never bother to delete it.  I understand that D does GC for me. I am interested in using either [timed GC](https://wiki.dlang.org/Memory_Management#Smooth_Operation) or a [free list](https://wiki.dlang.org/Memory_Management#Free_Lists) for finer control of GC.  Which is best for the application, do you think?
>

If you wish to automatically de-allocate the oldest atoms, one 
approach might be to put them in a ring buffer. Its size will 
affect the relative time needed for deleting and overwriting the 
oldest elements. You can hard code the size based on 
experimentation or allow ongoing automatic adjustment based on 
some formula.

I think there are some interesting ring buffer packages in the 
DUB registry.


More information about the Digitalmars-d-learn mailing list