Next pointer inside the struct
Next pointer inside the struct
Posted Sep 30, 2014 14:09 UTC (Tue) by nix (subscriber, #2304)In reply to: Next pointer inside the struct by andresfreund
Parent article: Quotes of the week
You can avoid this with a scheme whereby the list's per-item metadata is physically prepended to the content (sort of like container_of() only with the list metadata invisible to everything outside the list machinery, just like malloc()s metadata is invisible to everything outside it). Of course, this introduces a lot of complexity which may well not be necessary -- or, when it becomes clear it is necessary, the changes are scattered across so many disparate places that fixing it is out of the question. A sort of technical-debt tragedy of the commons.