Closed bararchy closed 9 years ago
Hi there,
So sorry for the delay
re:
sfilter = LibC::malloc(1024)
This will work but its kinda scary. Im not familiar with ruby or ruby's FFI, but you want to do something like LibC:malloc( sizeof(sfilter))
. I bet if you google hard you can a way of getting the "size of a c struct" or look for "sizeof" in FFI. Then it will be "proper".
good luck!
n
@client9 , Thanks for the tip, sadly the only option was to create an external c program and read the size of struct, I kept using malloc(1024) as this is safely above the needed space.
Also binded to Crystal -- https://github.com/bararchy/crystal-libinjection :)
Hi,
I'm working on wrapping your great lib using ruby, the project is here --> https://github.com/bararchy/ruby-libinjection
I'm having some issues with the lib calling memfree from within, maybe you can give me a tip in the right direction ?
https://github.com/bararchy/ruby-libinjection/issues/1
Thanks