Closed EngineerSmith closed 2 years ago
Looks like this might be the culprit, ByteData's clone method isn't exposed in the wrapper: https://github.com/love2d/love/blob/main/src/modules/data/wrap_ByteData.cpp#L34-L37
static const luaL_Reg w_ByteData_functions[] =
{
{ 0, 0 }
};
(Also, the wiki implies that clone also exists for the abstract Data type too, but looking at wrap_data.cpp, that doesn't seem to be the case - this might not be an issue though.)
Temp solution to this issue to clone a byteData:
local clone = function(byteData)
return love.data.newByteData(byteData:getString(), 0, byteData:getSize())
end
This solution is twice as fast than a cpp(ffi lib) memcpy in my benchmarks
I cannot clone a
byteData
object in love 11.3, the function is nil.Repo:
Links: https://love2d.org/wiki/ByteData https://love2d.org/wiki/Data:clone