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

Also for people new to C programming, don't forget about calloc!



It's worth noting that on modern OSes, the OS will forcibly zero out memory when it's allocated from the OS, so if you're allocating a really large sparse set (large enough to not come from existing free heap RAM), and don't intend to clear it a lot, sparse sets won't save any time, and calloc (which can skip the zeroing if it's getting new pages from the OS) will probably be a better idea.




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

Search: