<div dir="ltr">that is what I thought .. especially after just looking at the implementation for alloca/allocaBytes. For me and others on thie group is there documentation on the ghc run-time model and also the run-time library architecture. Both would help/aid in reading the code and of course educate more people?<br>
<br>Regards,<br><br>Vasili<br><br><div class="gmail_quote">On Thu, Aug 7, 2008 at 1:36 AM, Henning Thielemann <span dir="ltr">&lt;<a href="mailto:lemming@henning-thielemann.de">lemming@henning-thielemann.de</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 class="Ih2E3d"><br>
On Thu, 7 Aug 2008, Bulat Ziganshin wrote:<br>
<br>
&gt; Hello Vasili,<br>
&gt;<br>
</div><div class="Ih2E3d">&gt; Thursday, August 7, 2008, 9:33:32 AM, you wrote:<br>
&gt;<br>
&gt; oh, it was my mistake. alloca behavior is completely defined by it&#39;s<br>
&gt; generic implementation:<br>
&gt;<br>
&gt; allocaBytes &nbsp; &nbsp; &nbsp;:: Int -&gt; (Ptr a -&gt; IO b) -&gt; IO b<br>
&gt; allocaBytes size &nbsp;= bracket (mallocBytes size) free<br>
&gt;<br>
&gt; although GHC implementation is much more efficient<br>
<br>
</div>That is, it is not a good idea to use &#39;allocaBytes n return&#39; in order to<br>
carry a pointer of an allocated piece of memory out of the inner action.<br>
</blockquote></div><br></div>