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 AM, Alexander Gladysh <agladysh@gmail.com> wrote:
> On Thu, Jan 3, 2013 at 11:35 PM, Coda Highland <chighland@gmail.com> wrote:
>> On Thu, Jan 3, 2013 at 11:10 AM, Patrick <patrick@spellingbeewinnars.org> 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).
>
> Alexander.
>

Hmm, that's a good point. I've never written a library intended for
external use, so I've always been content using C++ operator
new/delete. Thanks for the clarification; I hadn't thought of that.

/s/ Adam