lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Fri, Jan 4, 2013 at 10:03 PM, Alexander Gladysh <> wrote:
> On Thu, Jan 3, 2013 at 11:35 PM, Coda Highland <> wrote:
>> On Thu, Jan 3, 2013 at 11:10 AM, Patrick <> wrote:
>>> So the C API is very simple but that does not mean it is simple enough for
>>> me ;)
>>> Are these functions mostly used internally and in advanced cases:
>>> lua_Alloc
>>> lua_getallocf
>>> lua_setallocf
>>> lua_Writter
>> Yes, those are primarily for advanced use as the defaults are good
>> enough for most applications.
> I always thought that it is a proper practice for modules is to use
> lua_getallocf() if they are allocating something "manually" — i.e.
> outside of Lua API (unless there is a reason to do otherwise for a
> particular use-case of particular module).

OTOH, "manual" allocation (i.e. not with lua_newuserdata) probably
counts as advanced use by itself.