<div dir="ltr">Waait. I didn't check but I'm not so sure it's supposed to work like that - I wonder why you had access to ___result_voidstar there at all.<div><br></div><div>Please allocate such a test structure *locally on the stack* within your struct-test procedure, and then set ___result to it. I.e., by value and not by pointer passing. Then paste here again.</div>

<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/19 Chris Mueller <span dir="ltr"><<a href="mailto:ruunsmail@gmail.com" target="_blank">ruunsmail@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 19.08.2013 12:16, Mikael wrote:<br>
><br>
> So in your past test with a pointered type, you did see the proper<br>
> behavior.  And here comes what applies to the current test:<br>
><br>
</div>>     In the case of the |struct|, |union| and |type| types, the default<br>
<div class="im">>     function reclaims the copy on the C heap referenced by the internal<br>
>     pointer (when using a C++ compiler this is done using ‘delete<br>
>     (type*)internal-pointer’, which calls the destructor of type if it<br>
>     is a class) and returns ‘___FIX(___NO_ERR)’.<br>
><br>
><br>
> Can you paste your full test code here?<br>
><br>
<br>
</div>Of course :)<br>
<br>
;; struct definition<br>
(c-declare "struct test { int a; int b; };")<br>
<br>
(c-define-type struct-test (struct "test"))<br>
<br>
(define struct-test<br>
   (c-lambda () struct-test "___result_voidstar = new test;"))<br>
<br>
;; test code<br>
(load "test")<br>
<br>
(define (alloc-struct n)<br>
<div class="im">   (let loop ((i 0))<br>
     (if (< i n)<br>
</div>       (let ((a (struct-test)))<br>
         (loop (+ i 1))<br>
         (write "FIN")))))<br>
<br>
(alloc-struct 100000000000)<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</div></div></blockquote></div><br></div>