<div dir="ltr">std::string requires delete to be used for proper deallocation and free() might just partially deallocate it, no? - what about trying with some more ordinary struct like tm ?</div><div class="gmail_extra"><br>

<br><div class="gmail_quote">2013/8/18 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 17.08.2013 22:59, Mikael wrote:<br>
> On struct it would make sense, it was indeed only pointered types I had<br>
> on my mind. Allocate a billion, see for yourself and tell here?<br>
<br>
</div>I've checked this with the following example.<br>
<br>
(define (alloc-string n)<br>
   (let loop ((i 0))<br>
      (if (< i n)<br>
        (let ((a (std::string "test")))<br>
            (loop (+ i 1)))<br>
         (write "FIN")))))<br>
<br>
When using (struct std::string ...) without a release function, memory<br>
grow's rapidly (checked this in htop) until it heap overflows.<br>
<br>
With a given release function memory assumptions is constantly small.<br>
<br>
Seems there is currently no difference in the deallocation behaviour<br>
between structs and pointer types.<br>
<br>
Too bad :/<br>
<div class="HOEnZb"><div class="h5"><br>
Chris<br>
<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>