• 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
GC and malloc question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GC and malloc question


  • Subject: GC and malloc question
  • From: Nick Rogers <email@hidden>
  • Date: Thu, 31 May 2012 20:59:07 +0530

Hi,

My program has to build a tree structure, the number of nodes, in which can run into many millions. So I began to make changes to allocate a node using malloc. Earlier I was using a object for a node.

I have GC enabled (required). And basically I'm making a linked list of nodes to store children nodes. The root node pointer is a member of a class and children nodes pointer are stored in root node.

Immediately after malloc'ing a node I'm using Garbage Collector method - disableCollectorForPointer, just to make sure, although GC is supposed to work only on objects, if I'm right.

My question is: will GC affect the node allocations in anyway and, also (GC or No GC) will the tree starting from a root node able to stay in memory until I free it. Because I'm getting EXC_BAD_ACCESS/KERN_PROTECTION_FAILURE, one after the other.

Will using - disableCollectorForPointer have any effect on this.

Best,
Nick
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: GC and malloc question
      • From: Sean McBride <email@hidden>
  • Prev by Date: Re: NSXMLParser and initWithStream
  • Next by Date: @synchronized crashing with ARC
  • Previous by thread: Re: NSSavePanel: Another sandbox issue
  • Next by thread: Re: GC and malloc question
  • Index(es):
    • Date
    • Thread