Comment

Comment by betterunix

Instead of pointers, you would store an index in the array of nodes:

  struct node {
     void * data;
     uint32_t idx_next;
  };
You are still dereferencing pointers, of course, but you have better locality, even after doing a lot of insertions and deletions.
parent betterunix 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton