[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Hooks for I/O, memory, etc?
- From: "Philip Bock" <phil@...>
- Date: Mon, 10 Jun 2002 15:13:34 -0600
You wouldn't necessarily have to integrate the callback mechanism with
lua_open. Much better in my opinion would be something like:
called just before lua_open so that it can still use the defaults if the
user doesn't want to write their own.
----- Original Message -----
From: "Roberto Ierusalimschy" <email@example.com>
To: "Multiple recipients of list" <firstname.lastname@example.org>
Sent: Monday, June 10, 2002 2:26 PM
Subject: Re: Hooks for I/O, memory, etc?
> > Callbacks for I/O and memory allocation seems, to me anyway, obvious
> > for an embedded API. Is there any drawback to it? Sure I have a
> > working implementation now, but I went through a
> The drawback is that everyone using Lua would have to start it with
> something like
> which is not exactly friendly... Note that you already can change memory
> allocation without editing the source:
> #ifndef l_realloc
> #define l_realloc(b,os,s) realloc(b,s)
> (5.0w0 still uses an extra l_free; we are removing it.) So all you need
> is to define your own "l_realloc" when compiling Lua.
> -- Roberto