-
-
Notifications
You must be signed in to change notification settings - Fork 89
Description
It would be nice if there were methods to obtain direct pointers to Lua strings. These would be an alternative to CheckBuffer and ToBuffer, though I wouldn't mind if OptBuffer didn't get the same treatment. These methods would be unsafe and return a byte*, of course, or probably an IntPtr.
My use case is for passing Lua strings directly into a function loaded from a C library. Currently, I have to use CheckBuffer to obtain the unprocessed character data, then allocate a new byte buffer with an extra byte allocated for the null byte, and then pass it to the C function. This extra processing is a waste of time. Plus, the NativeMethods class is internal, so I couldn't sanely access the function I wanted.
If instead this issue was implemented, it would give me peace of mind.