[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Searching for prior art.
- From: Julien Cugnière <julien.cugniere@...>
- Date: Tue, 11 Jan 2022 12:31:24 +0100
Le mar. 11 janv. 2022 à 12:08, Flyer31 Test <email@example.com> a écrit :
> Can you give an example how you do this? Do you avoid this "stack
> de-allocate" in Lua code or in C code?
> ... just for interest, sorry, I do not really understand what you mean
> by "stack re-allocate" / "stack de-allocate", but it sounds somehow
> interesting possibility... .
It can't be done in Lua, or with the public C API. It would be a
change inside the C implementation of Lua (Francisco was talking about
modifying the VM).
Basically, when growing the stack, instead of doing a realloc() (or
equivalent), simply malloc() a new one, and don't free() the old one
(until the C function is finished).