Re: GC / ARC question regarding screensavers under Mavericks

2015-01-16 Thread Sean McBride
On Sun, 4 Jan 2015 02:31:50 +0100, Gabriel Zachmann said: >Could it be that System Preferences does still expect screen savers to >be compiled with garbage collection? Probably. You can check if an app is built with GC using this:

GC / ARC question regarding screensavers under Mavericks

2015-01-03 Thread Gabriel Zachmann
I am trying to make my screensaver compile and run under Mavericks. I haven’t touched the code for some years, and I haven’t recompiled it for a few years. I have the latest Xcode and Mac OS X 10.9.5 on a MacBookPro 2014. When I opened the project, Xcode said that it had to convert it to ARC and

Re: Silly ARC question - explanation requested

2014-06-04 Thread Alex Zavatone
Sweet. Thanks guys. That's exactly what I needed to frame why this is bad to our former dot net guy. Cheers. On Jun 4, 2014, at 6:02 PM, Quincey Morris wrote: > On Jun 4, 2014, at 14:45 , Alex Zavatone wrote: > >> But I need to come up with an explanation of explain why that is a bad idea >

Re: Silly ARC question - explanation requested

2014-06-04 Thread Quincey Morris
On Jun 4, 2014, at 14:45 , Alex Zavatone wrote: > But I need to come up with an explanation of explain why that is a bad idea > and why it smells It smells because a computationally intensive while loop will stall the dispatch queue that’s stuck on it. If you’re programming with *threads*, it

Re: Silly ARC question - explanation requested

2014-06-04 Thread Ken Thomases
On Jun 4, 2014, at 4:26 PM, Alex Zavatone wrote: > On Jun 4, 2014, at 4:07 PM, Ken Thomases wrote: > >> You have a misconception as illustrated in the above quotes. I think you >> think of ARC as a garbage collector that needs idle time or for execution to >> return to the frameworks in order

Re: Silly ARC question - explanation requested

2014-06-04 Thread Alex Zavatone
On Jun 4, 2014, at 4:02 PM, Quincey Morris wrote: > I think the deeper problem is that a while loop of this kind in an > asynchronously executed block is a bit of a code smell. Exactly. But I need to come up with an explanation of explain why that is a bad idea and why it smells. I know it

Re: Silly ARC question - explanation requested

2014-06-04 Thread Alex Zavatone
On Jun 4, 2014, at 4:07 PM, Ken Thomases wrote: > On Jun 4, 2014, at 2:24 PM, Alex Zavatone wrote: > >> As it turned out, my coworker had created a dispatch_async thread to start >> processing the video and within it, started at a framecount of 0, >> incremented it within a while(true) loop an

Re: Silly ARC question - explanation requested

2014-06-04 Thread Ken Thomases
On Jun 4, 2014, at 2:24 PM, Alex Zavatone wrote: > As it turned out, my coworker had created a dispatch_async thread to start > processing the video and within it, started at a framecount of 0, incremented > it within a while(true) loop and grabbed the frame every time there was a new > framePi

Re: Silly ARC question - explanation requested

2014-06-04 Thread Quincey Morris
On Jun 4, 2014, at 12:24 , Alex Zavatone wrote: > His response was "Well, I was able to autorelease any offending bits within > the loop without a problem, what's the big deal?" I think the deeper problem is that a while loop of this kind in an asynchronously executed block is a bit of a code

Silly ARC question - explanation requested

2014-06-04 Thread Alex Zavatone
I was just reviewing a team member's code on iOS 7 for reading the CVPixelBuffer from a video frame, storing it in a UIImage and converting to grayscale. Was testing against 720p video in the iPad and was pretty surprised to see memory leak faster than I've ever seen before, but only after o

Re: Dumb ARC question

2013-01-01 Thread John McCall
On Dec 28, 2012, at 12:59 AM, Quincey Morris wrote: > On Dec 27, 2012, at 22:37, Rick Mann wrote: >> So, the usual bit about references being weak by default in C structs (and >> C++ classes) doesn't hold here. > > Huh? References aren't weak by default anywhere. > > Are you thinking of __usa

Re: Dumb ARC question

2012-12-28 Thread Rick Mann
On Dec 28, 2012, at 0:59 , Quincey Morris wrote: > Huh? References aren't weak by default anywhere. > > Are you thinking of __usafe_unretained? That's not weak, just unmanaged by > ARC, and it's the only ownership qualifier allowed by ARC for struct members > that point to objects (and there

Re: Dumb ARC question

2012-12-28 Thread Quincey Morris
On Dec 27, 2012, at 22:37, Rick Mann wrote: > So, the usual bit about references being weak by default in C structs (and > C++ classes) doesn't hold here. Huh? References aren't weak by default anywhere. Are you thinking of __usafe_unretained? That's not weak, just unmanaged by ARC, and it's

Re: Dumb ARC question

2012-12-27 Thread Rick Mann
On Dec 27, 2012, at 22:50 , Ludovic Nicolle wrote: > hey, is your project/target by any chance having NSZombieEnabled in its flags? > > there is/was a problem similar to this with zombies enabled so please make > sure this aint the case. My project was NOT NSZombieEnabled, but then it starte

Re: Dumb ARC question

2012-12-27 Thread Rick Mann
On Dec 27, 2012, at 21:58 , Rick Aurbach wrote: > Rick, > > I'm no Obj-C language expert; in fact I'm pretty much a newbie. But I have > had some experience with smart pointers (boost, etc) from my C++ case. > > Here's how I think of strong and weak references in ARC. (If the following is >

Re: Dumb ARC question

2012-12-27 Thread Rick Aurbach
Rick, I'm no Obj-C language expert; in fact I'm pretty much a newbie. But I have had some experience with smart pointers (boost, etc) from my C++ case. Here's how I think of strong and weak references in ARC. (If the following is wrong, I'm sure someone more knowledgeable than myself will set

Dumb ARC question

2012-12-26 Thread Rick Mann
I just wrote some Objective-C++ code. It's basically just a regular Obj-C class, but makes some C++-style calls in its methods. Anyway, I added an NSMutableData* ivar to my class, and set it with mInputBuffer = [NSMutableData data]; in one of the methods. Subsequent accesses, however, h

Re: ARC question

2012-10-31 Thread BobCromwell
Every assignment will release the old one,so no leak. From My iPhone 在 2012-10-29,下午7:34,Mike Abdullah 写道: > > On 29 Oct 2012, at 10:06, Vincent Habchi wrote: > >> Hi folks, >> >> before aught else, all my thoughts to those of you in the Eastern coast that >> are preparing themselves for a

Re: ARC question

2012-10-29 Thread Vincent Habchi
Mike: > How are those accented characters represented in your HTML? Thanks for pointing this. It turns out, after examination, that the accented chars are already provided in UTF-8, and that only & and ' need to be translated. Strange. I was sure I saw other escapes around on some contents bef

Re: ARC question

2012-10-29 Thread Mike Abdullah
On 29 Oct 2012, at 13:55, Vincent Habchi wrote: > Le 29 oct. 2012 à 14:34, Mike Abdullah a écrit : > >> Well, you can ask CFXMLCreateStringByUnescapingEntities() to do this on OS >> X, although if I recall all the CFXML functions have now sadly been >> deprecated. The source code for it shoul

Re: ARC question

2012-10-29 Thread Vincent Habchi
> That’s blatant. […] I meant obvious. I just read the use of “blatant” for “obvious” was incorrect. My bad. Vincent ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact t

Re: ARC question

2012-10-29 Thread Vincent Habchi
Le 29 oct. 2012 à 15:30, glenn andreas a écrit : > Given that there are also decimal (&#DD;) and hexadecimal escape sequences > (&#x;) in HTML, trying to support those through the use of a dictionary > of sequence -> replacement is going to be impractical. Hopefully, I have only to address

Re: ARC question

2012-10-29 Thread glenn andreas
On Oct 29, 2012, at 8:34 AM, Mike Abdullah wrote: > > On 29 Oct 2012, at 11:44, Vincent Habchi wrote: > >> Le 29 oct. 2012 à 12:34, Mike Abdullah a écrit : >> >>> The code is a fairly inefficient to start with, but no, it's not going to >>> leak. >> >> Thanks. I am aware of this, but sinc

Re: ARC question

2012-10-29 Thread Vincent Habchi
Le 29 oct. 2012 à 15:00, Kyle Sluder a écrit : > On Oct 29, 2012, at 6:55 AM, Vincent Habchi wrote: > > Actually, it's not. From the docs: > >> Note: Currently, only the standard predefined entities are supported; >> passing NULL for entitiesDictionary is sufficient. > > This kind of thing

Re: ARC question

2012-10-29 Thread Kyle Sluder
On Oct 29, 2012, at 6:55 AM, Vincent Habchi wrote: > Le 29 oct. 2012 à 14:34, Mike Abdullah a écrit : > >> Well, you can ask CFXMLCreateStringByUnescapingEntities() to do this on OS >> X, although if I recall all the CFXML functions have now sadly been >> deprecated. The source code for it sh

Re: ARC question

2012-10-29 Thread Vincent Habchi
Le 29 oct. 2012 à 14:34, Mike Abdullah a écrit : > Well, you can ask CFXMLCreateStringByUnescapingEntities() to do this on OS X, > although if I recall all the CFXML functions have now sadly been deprecated. > The source code for it should still be available if you search around. I wasn’t awar

Re: ARC question

2012-10-29 Thread Mike Abdullah
On 29 Oct 2012, at 11:44, Vincent Habchi wrote: > Le 29 oct. 2012 à 12:34, Mike Abdullah a écrit : > >> The code is a fairly inefficient to start with, but no, it's not going to >> leak. > > Thanks. I am aware of this, but since this code is going to be part of a > didactic article on writi

Re: ARC question

2012-10-29 Thread Mike Abdullah
On 29 Oct 2012, at 12:01, Vincent Habchi wrote: > Le 29 oct. 2012 à 12:53, Roland King a écrit : > >> Does CFURLCreateStringByReplacingPercentEscapes() not do this for you? I >> often use it going the other way from text to escaped text, not just for >> URLs. > > AFAIK, CFURLCreateStringBy

Re: ARC question

2012-10-29 Thread Vincent Habchi
Le 29 oct. 2012 à 12:53, Roland King a écrit : > Does CFURLCreateStringByReplacingPercentEscapes() not do this for you? I > often use it going the other way from text to escaped text, not just for > URLs. AFAIK, CFURLCreateStringByReplacingPercentEscapes() substitues special chars for % in U

Re: ARC question

2012-10-29 Thread Roland King
On 29 Oct, 2012, at 7:44 PM, Vincent Habchi wrote: > Le 29 oct. 2012 à 12:34, Mike Abdullah a écrit : > >> The code is a fairly inefficient to start with, but no, it's not going to >> leak. > > Thanks. I am aware of this, but since this code is going to be part of a > didactic article on wr

Re: ARC question

2012-10-29 Thread Vincent Habchi
Le 29 oct. 2012 à 12:34, Mike Abdullah a écrit : > The code is a fairly inefficient to start with, but no, it's not going to > leak. Thanks. I am aware of this, but since this code is going to be part of a didactic article on writing a WMS client, I emphasize clarity over performance (this is

Re: ARC question

2012-10-29 Thread Mike Abdullah
On 29 Oct 2012, at 10:06, Vincent Habchi wrote: > Hi folks, > > before aught else, all my thoughts to those of you in the Eastern coast that > are preparing themselves for a bunch of bleak days… > > I’ve just a silly question (I know, I don’t post very often and I apologize > for that): I ne

ARC question

2012-10-29 Thread Vincent Habchi
Hi folks, before aught else, all my thoughts to those of you in the Eastern coast that are preparing themselves for a bunch of bleak days… I’ve just a silly question (I know, I don’t post very often and I apologize for that): I need to convert a HTML style string, with “& escapes” to normal UTF