I haven't looked at Linux kernel sources, but I read about this "linked list" usage in the kernel. Embedded link pointers is also a good point.
Do you happen to have a good example for it?
Re:Why does Lisp use cons cells? (1998)
by kerkeslager on Tuesday October 15, 2024 @12:00AM
(#41844821)
Let's not pretend this proves your point in any way. Intrusive lists in a manually managed memory system are incomparable to the cons cell based linked lists in a garbage collected system which you're defending. This is particularly true when the intrustive lists require no memory allocation.
Re:Why does Lisp use cons cells? (1998)
by kerkeslager on Monday October 14, 2024 @11:57PM
(#41844809)
> Quite often but not always linked lists in C are intrusive.
Yes, and that's a significantly different data structure from a cons-cell based list, so I don't think it's particularly relevant. C and C++ certainly aren't examples of one of the languages lispm is claiming uses the Lisp model.
> And so no memory allocation is required to insert those objects into a list.
This is a pretty key distinction which doesn't apply to the linked list objects I'm talking about.
I don't think I've ever worked on a C++ or C project that had no linked lists anywhere. I'm trying to think of an example but coming up blank.
Quite often but not always linked lists in C are intrusive. Certain object are going to be put into exactly one list. Or more than my list but only one at a time. So the link pointer or pointers are embedded into that object. And so no memory allocation is required to insert those objects into a list. A classic example of this is putting a process structure onto a scheduling queue. You would never want a vector for this, for reasons that a professional such as yourself should understand.