lua-users home
lua-l archive

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


I don't know if this has been discussed before. I seached the archive 
but to no avail. 

Anyway it appears that lua_pushstring() and lua_pushlstring() take a 
copy of the string that is passed, which is all fine. However I need 
to call into lua lots of times, i.e. 100's of millions of times with 
30-40 parameters each time, and all those little malloc's and mempy's 
start to add up.

Is there anyway to pass strings to lua but tell it. "Hey here's the 
parameter, but don't bother copying it 'cause I don't want you to 
change it.

Is it something to do with userdata tags? If so how do I tell it "its 
userdata, but treat it like a string"?