<div dir="ltr">Hi Chris,<div><br></div><div>Yes this is a good Q.<br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/20 Chris Mueller <span dir="ltr"><<a href="mailto:ruunsmail@gmail.com" target="_blank">ruunsmail@gmail.com</a>></span><br>

<div>.. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"></div>
(define struct-test<br>
   (c-lambda () struct-test "struct test x; ___result = x;")) </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But if i run the test script with this function, i get a<br>
segmentation fault immediately.<br></blockquote><div>Weird!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There is also another option which comes in my mind:<br>


<br>
(define struct-test<br>
   (c-lambda () struct-test "struct test x; ___result_voidstar = &x;"))<br>
<br>
This is e.g. running the allocation loop. But it will segfault when<br>
quiting the script with CTRL + X.<br></blockquote><div><br></div><div>Weird too!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But it would be great, if we could clarify later the proper usage of<br>
structs in the ffi. I've gotten curious about that. :)</blockquote><div><br></div><div><br></div><div>Sounds like a good time to ask Marc!</div><div><br></div><div><br></div><div>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).</div>

<div><br></div><div>Best regards,</div><div>Mikael</div><div><br></div></div></div></div></div>