Re:The true cost of linked lists
by MontyCarloHall on Monday June 06, 2022 @08:12AM
(#31639476)
Why not just implement this as an array of constant width pointers to the heterogeneous data types?
Re:The true cost of linked lists
by LorenPechtel on Monday June 06, 2022 @01:09PM
(#31643029)
Which is what happens in most modern languages. The items in your list are objects--which internally are just pointers to the data. There's no performance penalty for having variable-sized objects in the list.
Vectors and arrays have the problem of needing contiguous memory. If an inner cell can have different size, or worse change it mid work, things get ugly really fast.