Re: How does a free list work?

2020-05-12 Thread Pavel Shkadzko via Digitalmars-d-learn
On Saturday, 9 May 2020 at 22:48:46 UTC, Simen Kjærås wrote: On Saturday, 9 May 2020 at 19:54:44 UTC, Pavel Shkadzko wrote: [...] The GC keeps a list of roots - that is, objects that are known to be active and should not be collected. The static freelist is one of those - since it's static

Re: How does a free list work?

2020-05-09 Thread Simen Kjærås via Digitalmars-d-learn
On Saturday, 9 May 2020 at 19:54:44 UTC, Pavel Shkadzko wrote: I have been reading about memory management in D on https://wiki.dlang.org/Memory_Management and found an example of a free list (pattern?): "Free lists are a great way to accelerate access to a frequently allocated and discarded

How does a free list work?

2020-05-09 Thread Pavel Shkadzko via Digitalmars-d-learn
I have been reading about memory management in D on https://wiki.dlang.org/Memory_Management and found an example of a free list (pattern?): "Free lists are a great way to accelerate access to a frequently allocated and discarded type.". Here is the example of free list: