Hi Chris,
Yes this is a good Q.
2013/8/20 Chris Mueller ruunsmail@gmail.com ..
(define struct-test (c-lambda () struct-test "struct test x; ___result = x;"))
But if i run the test script with this function, i get a segmentation fault immediately.
Weird!
There is also another option which comes in my mind:
(define struct-test (c-lambda () struct-test "struct test x; ___result_voidstar = &x;"))
This is e.g. running the allocation loop. But it will segfault when quiting the script with CTRL + X.
Weird too!
But it would be great, if we could clarify later the proper usage of structs in the ffi. I've gotten curious about that. :)
Sounds like a good time to ask Marc!
Now just for absolute clarity, can you please paste the total code of your three different examples (the one leaking and the two sigsegv:ing).
Best regards, Mikael