lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Saturday 04 February 2006 22:22, Asko Kauppi wrote:
> Hm, I was thinking of suggesting that (local buffer) to David, but
> that's way too bad design considering multithreaded applications.
>
> But having the local buffer in stack (not 'static') is safe; David,
> is that an option?
[...]

Well, I am single-threaded. But the string doesn't have a maximum bound, so I 
don't know how big to make the buffer.

I suppose I could have a persistant buffer that I reallocate whenever it's too 
small for a given string, but it still seems a bit of a waste.

It *should* be possible, theoretically, to tell Lua to create a string on the 
stack, allocating space for a certain size but not initialising it. I can 
then get a string pointer later (i.e., the next statement) and fill in the 
data...

-- 
+- David Given --McQ-+ "There is one thing a man must do // Before his
|  dg@cowlark.com    | life is done; // Write two lines in APL // And make
| (dg@tao-group.com) | the buggers run."
+- www.cowlark.com --+ --- The Devil's DP Dictionary

Attachment: pgpPS0QcmabCE.pgp
Description: PGP signature