<div dir="ltr"><br>If I am correct, I cannot associate a ForeignPtr with alloca or allocaBytes object via &quot;newForeignPtr&quot; because the alloca/allocaBytes heap object will be GC&#39;d when I leave the function that allocated this object/. I.e. if I have a heap object that I want to live beyond a function invocation, I must be very careful in coding.... <br>
<br>Vasili<br><br><div class="gmail_quote">On Thu, Aug 7, 2008 at 12:30 AM, Galchin, Vasili <span dir="ltr">&lt;<a href="mailto:vigalchin@gmail.com">vigalchin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">so Bulat .. <br><br>&nbsp;&nbsp;&nbsp;&nbsp; You seem to be saying what I suspect ... i.e. if an allocaBytes call is inside a function, when the function is exited then the said heap object is GC&#39;d??<br><br>Regards, Vasili<div>
<div></div><div class="Wj3C7c"><br>
<br><br><div class="gmail_quote">On Thu, Aug 7, 2008 at 12:25 AM, Bulat Ziganshin <span dir="ltr">&lt;<a href="mailto:bulat.ziganshin@gmail.com" target="_blank">bulat.ziganshin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hello Vasili,<br>
<div><br>
Thursday, August 7, 2008, 9:13:43 AM, you wrote:<br>
<br>
&gt; &nbsp;&nbsp;&nbsp; What is the lifetime of various heap objects ... e.g. created by allocaBytes, alloca, etc?<br>
<br>
</div>alloca/allocaBytes just mimicks stack allocation but actually allocates<br>
buffer in usual heap. this buffer lives while references to it exists<br>
<br>
on practice, it&#39;s usually gc&#39;ed by next minor GC<br>
<font color="#888888"><br>
--<br>
Best regards,<br>
&nbsp;Bulat &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mailto:<a href="mailto:Bulat.Ziganshin@gmail.com" target="_blank">Bulat.Ziganshin@gmail.com</a><br>
<br>
</font></blockquote></div><br></div></div></div>
</blockquote></div><br></div>