[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Pooling of strings is good
- From: Coroutines <coroutines@...>
- Date: Mon, 25 Aug 2014 03:37:19 -0700
On Sun, Aug 24, 2014 at 8:06 PM, Sean Conner <sean@conman.org> wrote:
> Good lord! Is there nothing you don't want to change? Yes, I realize
> that every computer science problem can be solved by another layer of
> indirection [1] but it does slow things down.
You can "rename" modules at runtime but not userdata internal
typenames -- you would have to recompile whatever defines those types.
This seems like a blindspot to me..
> Um, you map files into memory with mmap(). You can also mmap() memory
> without a file to allocate memory. You do one or the other.
Yes, I was thinking you could create a page-sized buffer with mmap(),
then wrap the fd in a lua_Stream -- then write to that memory with
recv() -- and be able to :read() from it in Lua -- now you're dealing
with the file type that Lua has a friendly interface to. Not a simple
black box that is "normal userdata". It's just sad that :read() would
create strings for you from that -- I still want to use the string.*()
functions on userdata somehow.