r/lua • u/Igor_GR • Oct 06 '25
How to detect memory leaks when working with LuaJIT FFI?
What the title says.
I'm trying to use LuaJIT FFI to make tiny-ish games for my Miyoo Mini with SDL. The issue is that I have no clue how one would check for memory leaks. It is relatively straightforward with valgrind for compiled programs, but is there anything similar to use with LuaJIT?
7
Upvotes
2
u/hawhill Oct 06 '25
I wouldn't call it "relatively straightforward" for "normal" compiled programs with valgrind, but if you're satisfied there, the answer to your question is "use valgrind", I guess. You need to compile LuaJIT with debug symbols and Valgrind support - https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/Makefile#L134
0
u/[deleted] Oct 13 '25
[deleted] — view deleted comment