[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is it time to remove dofile/loadfile? (was: Can a Lua module find out whether it is being required or dofiled?)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 25 Sep 2015 10:01:14 -0300
> 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