lua-users home
lua-l archive

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


 > >will there be a way to retrieve strings by reference,
 > >so they don't have to be copied (and possibly could be modified
 > >in place?).  Some strings would be rather long, and it would
 > >good to avoid copying them excessively, and also it would be useful
 > >to use a string as preallocated space to store information.
 > 
 > you can always store the pointer as userdata, but you won't be able to
 > use it as string without duplicating the string in Lua.

I'm saddened by this.  My code has two copies of every `unique'
string: one for C code and one for Lua code.  I use the C interface
because it's extremely fast, and I can't find an obvious way to use
the Lua unique-string table from C.  (I don't want these strings
garbage-collected.)  I'm probably missing something.  What?

Norman