Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe I didn't read the code right but where does it check whether a retrieved buffer is the right size? The makebuffer() routine appears to generate random size buffers but that length then doesn't get checked.

My experience from embedded systems is that buffer rings are great if you can predict two or three common sizes that cover your typical allocation needs.

I think even for people that work mostly in GC environments it's a good idea to read through the basic mechanism of heap management and allocation strategies. This article is a good intro to the basic idea and I like the charting and analysis being done.



The sample code does not check the buffer size. This is a slightly artificial example to show the technique and have some interesting graphs to back it up.




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

Search: