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

> Wrong! https://github.com/Tarsnap/libcperciva/commit/cabe5fca76f6c3....

No, of course not "Wrong!"

If a user of a library wants to supply their own allocator, they must provide a version of realloc that acts as free() for the (p,0) case. That's the semantics the library expects, observe them. Internally the lib may look at whether a custom realloc is set, and fallback to malloc/free if it's not.



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

Search: