News for hackers. Stuff that matters.
Re:Zig's new LinkedList API (it's time to learn fieldParentPtr) by lightingthedark on Monday April 14, 2025 @09:24AM (#43680997)
Okay so in the multiple list case performance would actually be worse because you'd have a double pointer dereference. I was thinking you'd have the list nodes contiguous in memory so the first dereference would always hit cache but that's a bad assumption for a linked list.

Since you shouldn't reach for a linked list as a default data structure modern hardware anyway, I actually do see how this change makes sense for Zig. Neat!

Re:Zig's new LinkedList API (it's time to learn fieldParentPtr) by codr7 on Wednesday April 16, 2025 @08:42AM (#43704712)
Allocating list nodes in one block of memory is very common in the intrusive case.