• 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
NSAllocateCollectable() questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAllocateCollectable() questions


  • Subject: NSAllocateCollectable() questions
  • From: Brendan Younger <email@hidden>
  • Date: Tue, 15 Apr 2008 00:42:07 -0500

Hi all,

This is a re-post since I didn't receive any response on Sunday.

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


  • Follow-Ups:
    • Re: NSAllocateCollectable() questions
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: Subclassing NSArrayController
  • Next by Date: Re: NSDateFormatter giving different results in different programs
  • Previous by thread: Re: Subclassing NSArrayController
  • Next by thread: Re: NSAllocateCollectable() questions
  • Index(es):
    • Date
    • Thread