<div dir="ltr">Hi Holger,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 26, 2018 at 8:32 AM, Holger Freyther <span dir="ltr"><<a href="mailto:holger@freyther.de" target="_blank">holger@freyther.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On 26. Mar 2018, at 00:00, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br>
><br>
> Hi Holger,<br>
<br>
Hey!<br>
<span class=""><br>
<br>
> Is the intent of CCallOut with: aBlock to collect and defer deallocations until the block completes?  I think it's nice but complex and wonder how general it is.  But it seems like it would impact a lot of code and require a lot of effort changing existing code bases.  My handle scheme is only intended to fix the issue of images crashing on startup. The problems with crashing on startup being a) one loses one's work and b) the issue is hard to debug.  That, for me, motivates something like the simple fix I p[roposed.  I'm not standing in the way of something more beautiful, but I do believe that one shouldn't make the perfect the enemy of the good.<br>
<br>
</span>By all means, let's have a smart pointer! It will be beneficial for freetype and many other places. Nobody likes crashing images (for a mistake made in a previous run).<br>
<br>
<br>
My intent with the CCallOut is inhibit image saving until the code is outside a sequence of (interruptible, hence the backward jump int the example) C calls working with one or more pieces of manually managed memory. But maybe it is best to call it by what it does instead of finding a name of where it is used.<br>
<br>
I can't come up with a better example right now. But I think a Smartpointer wouldn't be of much help with a sequence of strtok calls.<br>
<br>
        word := CStringAPI strtok: cStringPtr safeBytes separator: '\r'.<br>
        [word isNil] whileFalse: [<br>
                word = 'Foo'...<br>
                word = 'Bla'...<br>
                word := CStringAPI strtok: nil separator: '\r'<br>
 ------------- Image Save happening right here and word is not nil -----<br>
        ].<br>
<br>
I hope this is more clear.<br></blockquote><div><br></div><div>Right.  So the VM could have a flag that, when set, causes the snapshot primitive to fail, and that flag would be cleared only when all FFI cals had unwound.  Would that be enough?  What would you have the image do if snapshot fails because FFI calls are in progress?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">holger<br>
</font></span></blockquote></div><br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>