lua-users home
lua-l archive

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

> Side note: I noticed that liolib.c:g_read will create a new userdata
> (via luaL_Buffer) for each read in cases where the number of
> characters to read exceeds LUAL_BUFFERSIZE (8192). This could be
> optimized by associating a buffer with the io_readline closure or
> perhaps even the file.

I changed that implementation. Now the buffer allocates space directly
(through the allocation function) and frees that space when it is done.
(When growing, it can reallocate the space, instead of creating a new
one as it has to be done with userdata.)

-- Roberto