[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Hooks for I/O, memory, etc?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 10 Jun 2002 17:26:30 -0300
> 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
lua_open(&realloc);
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)
#endif
(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
- Follow-Ups:
- Re: Hooks for I/O, memory, etc?, Philip Bock
- RE: Hooks for I/O, memory, etc?, Pyrogon Public
- RE: Hooks for I/O, memory, etc?, Joshua Jensen
- Re: Hooks for I/O, memory, etc?, J. Perkins
- Re: Hooks for I/O, memory, etc?, Björn De Meyer