<div>No you do not need the RELEASEOBJ<br></div><div><br></div><div>Before ARC there was a lot of work involved in managing memory. <br></div><div>For situation where you allocated or made a copy of an object (various rules). <br></div><div><br></div><div>X = [NSMutableArray alloc] init]);<br></div><div><br></div><div>Then you had to ensure you released the object when you were done via release, or tag it via autorelease<br></div><div><br></div><div>For the case where an object was created but autoreleased you then had to ensure you retain it either via an explicit retain or use of a retain property, <br></div><div><br></div><div>So <br></div><div>saying <br></div><div>self.retainedObject = [NSArray array]; //returns autorelease object</div><div>versus <br></div><div>retainedObject = [[NSArray alloc] init];<br></div><div><br></div><div>had very different meaning as the self. would do the assignment and retain, but use without self. would not do the retain, which was not needed as the alloc/init gives a retain count of 1. <br></div><div><br></div><div>Post ARC the compiler is aware of the scope of the life of the object and inserts retain/release as needbe. <br></div><div><br></div><div>That all said what is going on is very subtle. The actual problem is that the <br></div><div>X = [NSMutableArray alloc] init]);<br></div><div>is handled OK by ARC because the object is autoreleased when the method ends.<br></div><div><br></div><div>However the question is well what happens to the auto release pool? <br></div><div>When does that get cleaned up? <br></div><div><br></div><div>That is the actual problem, and adding the auto-release pool cleans up the NSEvents that are creating the majority of the garbage, since there is no autorelease wrapper for the callout from the interp.c code. <br></div><div><br></div><div>There likely are others, mmm <span style="background-color:rgb(255, 255, 255)"><span style="color:rgb(0, 0, 0)"><span style="font-family:Menlo"><span style="font-size:13px">ioSetCursor</span></span></span></span><br></div><div><span style="background-color:rgb(255, 255, 255)"><span style="color:rgb(0, 0, 0)"><span style="font-family:Menlo"><span style="font-size:13px">Maybe there needs to be a general rule that any call outs to obj logic from interp.c have to have an autorelease pool? </span></span></span></span><br></div><div><br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user"><div><span style="font-family:arial, sans-serif"><span style="background-color:rgb(255, 255, 255)"><span style="font-size:12.800000190734863px">....</span></span></span><br></div><div><span style="background-color:rgb(255, 255, 255)"><span style="color:rgb(34, 34, 34)"><span style="font-family:arial, sans-serif"><span style="font-size:12.800000190734863px">John M. McIntosh. Corporate Smalltalk Consulting Ltd </span></span></span></span><a style="font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(17,85,204);font-family:arial, sans-serif;font-size:12.800000190734863px;" href="https://www.linkedin.com/in/smalltalk">https://www.linkedin.com/in/smalltalk</a><br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Thursday, February 28, 2019 9:59 AM, Tobias Pape <notifications@github.com> wrote:<br></div><div> <br></div><blockquote class="protonmail_quote" type="cite"><div><br></div><div>> Ok, as @krono pointed out<br></div><div> > NSMutableArray *alienEventQueue = AUTORELEASEOBJ([[NSMutableArray alloc] init]);<br></div><div> > with the autoreleasepool.<br></div><div> <br></div><div> Do we need the `RELEASEOBJ` in this case?<br></div><div> <br></div><div> <br></div><p style=""><span style="color:rgb(102, 102, 102)"><span style="font-size:small">—<br>You are receiving this because you are subscribed to this thread.<br>Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/373#issuecomment-468373330">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW0_DSJBNfTEFzQknE8qU_rqNMnwtks5vSBkBgaJpZM4bWbAu">mute the thread</a>.<img alt="" width="1" height="1" src="https://github.com/notifications/beacon/AhLyW1WDw1yRcebe--Kg_9iwavoIEtkiks5vSBkBgaJpZM4bWbAu.gif" class="proton-embedded"></span></span></p></blockquote><div><br></div>