Hacker News new | ask | show | jobs
by malisper 41 days ago
Yeah, that looks like a freelist approach. That will work as long as the values you're allocating are all fixed-size. You'll need something much more complicated if you want arbitrarily sized values

That example implements a linked list of integers. I'm curious how you would do a linked list of strings

1 comments

you can make each string a linked list of bytes (or chunks of bytes). But it won't be efficient.