Got it ... makes sense ... thanks Alex :)
Regards,
Kashyap

On Tue, Mar 2, 2021 at 10:04 PM Alexander Burger <a...@software-lab.de>
wrote:

> Hi Kashyap,
>
> > I noticed that in the linked list of free cells, "car" is used as the
> next
> > pointer. Is the choice arbitrary? I could've been "cdr" too right? Just
> > curious if there is some interesting reason behind it :)
>
> It is almost arbitrary. A very tiny, very theoretical, reason is a possibly
> faster traversal of the heap when the CDRs are not needed (e.g. when
> counting
> the length of the free list), because then the access is a direct pointer
> dereference without the need for an offset in the CPU instruction.
>
> On a modern CPU the effect is not measurable at all.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>

Reply via email to