Thanks. I ever think ffi.C.malloc is same as C malloc. So Never mix use
ffi.C.malloc & C free or C malloc & ffi.C.free.
At 2021-12-03 23:50:00, "Mike Pall" wrote:
That's a common problem on Windows: you're mixing two different
memory allocators in one program.
The FFI dynamically loads whatever functions are named 'malloc'
and 'free' from the global namespace (ffi.C). But your C/C++
program may compile and link against completely different
functions. This is up to the toolchain and its settings.
--Mike