Pointer.autorelease
The Pointer.autorelease property controls wether the pointed memory is freed by the Lua garbage collector, or not (the default).
Example
local crt = c.Library()
-- Use the Library instance to define the C function "_strdup()"
-- this function takes one arguments of the Z type (const char *)
-- and returns a char* value for the duplicated string
crt._strdup = "(Z)p"
-- Calls the just defined C function, returning a new C Pointer
local ptr = crt._strdup("Hello LuaRT")
-- Prints the duplicated string
print(ptr:as("char*"))
-- the _strdup() function returns a pointer that must be freed by the user
ptr.autorelease = true