[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Is terminating null required for Lua strings?
- From: "Juris Kalnins" <juris@...>
- Date: Mon, 16 Feb 2009 14:04:38 +0200
All Lua strings are created using newlstr(), which always adds '\0' at the end of allocated string.
Would Lua work without this terminating null?
How much change is needed to make it work?
Why:
I have modified Lua to keep data separately from the TString header, so that it can reside in memory that is not managed by Lua. However, there might be some cases when target data may have no terminating null. I want to know if Lua can operate correctly with string data even if no terminating null is present, or does such data always require copying.
--j<