Hacker News new | past | comments | ask | show | jobs | submit login

OK you piqued my curiosity. How?



You just mmap memory as a slice. You can grow and shrink it, flush to disk if backed by a file, etc. In code it’s just a slice. Tough part is you need to allocate, control bounds, binary encode/decode, struct align, defrag, etc. It’s hard work, but the performance is 100% worth it if performance is your main goal.


TIL mmap'd memory is invisible to Go's GC


malloc isn't magic, just mmap some memory to dole out.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: