• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: alloc init thread safe?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alloc init thread safe?


  • Subject: Re: alloc init thread safe?
  • From: James Bucanek <email@hidden>
  • Date: Fri, 9 Mar 2007 07:58:24 -0700

David Carlisle wrote on Thursday, March 8, 2007:
>@implementation LTX_Analyzers
>
>- (ControlMethods2 *) CM_alloc_init {
>   // [alloc_init_Lock lock];
>   CM_Analyzers *CM = [[CM_Analyzers alloc] init];
>   // [alloc_init_Lock unlock];
>   return CM;
>}

I'll point out that -alloc will return nil if you run out of memory. And one easy way to run out of memory is to turn on NSZombies.

NSZombies basically keeps every object you ever allocated around forever. I have some very object-intensive routines that spew millions of temporary objects. Some of these can't be debugged with NSZombie because the application will run out of memory space before it gets to the bug. When it does [Class alloc] returns nil, and much craziness ensues.

--
James Bucanek
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: alloc init thread safe?
      • From: David Carlisle <email@hidden>
References: 
 >Re: alloc init thread safe? (From: David Carlisle <email@hidden>)

  • Prev by Date: Re: CoreData Questions
  • Next by Date: Re: NSURL Containing RTSP and Password?
  • Previous by thread: Re: alloc init thread safe?
  • Next by thread: Re: alloc init thread safe?
  • Index(es):
    • Date
    • Thread