Ffi.C missing all ads for all characters

I see in the documentation ffi.C.free is what I can use to free malloc. I am trying to do it here:

callbacks.free_buffer = function(buffer) 
  print("free_buffer_callback") 
  ffi.C.free(buffer)
end

      

I am getting this error:

missing declaration for symbol 'free'

      

does this mean that I have to focus the memory on FFI first? I cannot do this in this particular function (because it is a parameter in the callback). What can I do to free this buffer?

EDIT: It looks like all ffi.C functions don't work, even outside the callback function. My ffi seems to be working fine otherwise?

+3


source to share


1 answer


Unfortunately, I didn't put it free

in mine cdef

! Fixed.



ffi.cdef[[
  void free(void *ptr);
]]

      

+4


source







All Articles