[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: how to use lmem.h ?
- From: Bertrand Mansion <lua@...>
- Date: Sat, 21 Feb 2009 15:27:08 +0100
I am trying to create a C module for Lua. One of the functions deals
with string quoting so I need to allocate a buffer with 2 times +1 the
memory occupied by the source string. Usually, I would use malloc()
but I noticed that there is a lmem.h file with a luaM_malloc()
function, so I could write something like this:
to = luaM_malloc(L, 2 * size);
Unfortunately, #include "lmem.h" doesn't work if I install Lua using
the default Makefile (I am on Macosx). Is there a way to build Lua or
some extra steps I should do manually in order to be able to use
"lmem.h" ? Thanks,
--
Bertrand Mansion
Mamasam