[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Create 'overridden' lua_tolstring/lua_tostring
- From: "Thomas Harning Jr." <harningt@...>
- Date: Fri, 21 Sep 2007 00:45:29 -0400
Would it be possible to override lua_tolstring/lua_tostring such that
they could use a userdata function that returns a pointer+length into
an 'external' buffer that could be guaranteed to be unchanged for a
specific duration? I'm thinking this would be particularly useful in
making my luaevent libary's event_buffer object consumable by various
libraries (lua's regex, lpeg, etc) w/o having to muck around w/
creating string instances that end up getting hashed/etc even if
parsing would end up using a small amt of the data or failing...
I vaguely recall something like this being discussed in the past, but
I can't find it.
(Plug: http://luaforge.net/forum/forum.php?forum_id=1331 )
Thomas Harning Jr.