• 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
Some GC questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some GC questions


  • Subject: Some GC questions
  • From: Brendan Younger <email@hidden>
  • Date: Sun, 13 Apr 2008 13:58:19 -0400

Hello,

I've been writing a library that uses NSAllocateCollectable() quite a bit and I have a few questions about proper usage.

- Copying data
if I am copying to a malloc'd block, I can use memmove() regardless of whether the source is GC'd or not, right?
if I am copying to a GC block allocated with NSScannedOption, I need to use objc_memmove_collectable(), right?
if I am copying to a GC block allocated with nonscanned memory, I can use memmove(), right?


- Zero'ing data
There does not seem to be a GC-compatible bzero(). If I loop through and zero out each pointer in a scanned block, that would generate a write barrier for each pointer which is expensive. However, if I use bzero(), then libauto won't know that I've messed with the block. Will it eventually figure it out when it does an exhaustive scan? Or will it never notice that I've zero'd out the block?


Thanks,
Brendan
_______________________________________________

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


  • Prev by Date: Window moved when dock appears.
  • Next by Date: Re: Why should we set ivars to nil in dealloc?
  • Previous by thread: Re: Window moved when dock appears.
  • Next by thread: Re: NSArray to NSString
  • Index(es):
    • Date
    • Thread