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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to