|
The manual says that "ptr is NULL if and only if osize is zero." Besides, my implementation closely follows the sample implementation in the user manual: http://www.lua.org/manual/5.1/manual.html#lua_Alloc
I tried to write an allocator that respects all the rules in the user manual, one by one: