[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Hooks for I/O, memory, etc?
- From: "Peter Prade" <prade@...>
- Date: Tue, 11 Jun 2002 14:10:36 +0200
> > lua_open. Much better in my opinion would be something like:
> >
> > lua_userealloc(&my_custom_realloc);
> >
> > called just before lua_open so that it can still use the defaults if the
> > user doesn't want to write their own.
>
> If we call it before lua_open, where would we store such value? (Lua
> uses no global/static variables. Everything in Lua is stored in a
> lua_State, which is created by lua_open.)
you could pass a pointer to a struct that holds the callback pointers to
lua_open (defaulting to NULL).
or make two versions of lua_open: one with no extra parameters, and one
which lets you specify all the hooks.
Cheers,
Peter