On Wed, Sep 13, 2023 at 7:15 PM <andrey.konovalov@xxxxxxxxx> wrote: > > From: Andrey Konovalov <andreyknvl@xxxxxxxxxx> > > Instead of using the global pool_offset variable to find a free slot > when storing a new stack record, mainlain a freelist of free slots > within the allocated stack pools. > > A global next_stack variable is used as the head of the freelist, and > the next field in the stack_record struct is reused as freelist link > (when the record is not in the freelist, this field is used as a link > in the hash table). > > This is preparatory patch for implementing the eviction of stack records > from the stack depot. > > Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx> Reviewed-by: Alexander Potapenko <glider@xxxxxxxxxx>