Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Objective-C 2.0
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C 2.0




On 8.8.2006, at 22:03, Jason Jasmin wrote:

<snip>
So it appears (to me) that a full-blown GC which can collect any Obj-C type is possible. I've read speculation that there would be a separate pool type for GC objects, the last sentence of that comment seems to confirm that -- being able to reference GC'able objects from "standard" objects & vice-versa.



This has been in the Foundation reference for a while:

void *NSAllocateCollectable(unsigned long size, unsigned long options)
Discussion

Allocates size bytes and returns a pointer to the allocated memory.

options can be 0 or NSScannedOption: A value of 0 allocates nonscanned memory; a value of NSScannedOption allocates scanned memory.

This function returns NULL if it’s unable to allocate the requested memory.

Availability

Available in Mac OS X v10.4 and later.

Similar for:

void *NSReallocateCollectable(void *ptr, unsigned long size, unsigned long options)

Source:

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ Miscellaneous/Foundation_Functions/index.html#//apple_ref/doc/uid/ TP40003774

Also from nm Foundation:

         U _CFMakeCollectable
92928794 T _NSAllocateCollectable
92a1e810 T _NSCollectedScannedZone
92a1e850 T _NSCollectedUnscannedZone
9295af60 T _NSReallocateCollectable

And from nm CoreFoundation:

9087a754 S CFMakeCollectable.eh
907ef8c4 T _CFMakeCollectable
90849298 t __CFStringCreateCopyCollected
90848e4c t __CFStringCreateCopyCollected
a07b925c d ___CFCollectableZone
a07b9260 D ___CFObjCIsCollectable
a07b926c D ___CFObjCMemmoveCollectable
a07b9210 D _kCFUseCollectableAllocator
9084616c t _objc_isCollectable_nope
00000000 a objc_isCollectable_nope.eh

It looks like GC is available in Tiger as well, but is not documented...

<snip>


Stefan
--
http://stefan.agentfarms.net

First they ignore you, then they laugh at you, then they fight you, then you win.
- Mahatma Gandhi




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Objective-C 2.0 (From: "Philippe C.D. Robert" <email@hidden>)
 >Re: Objective-C 2.0 (From: Dietmar Planitzer <email@hidden>)
 >Re: Objective-C 2.0 (From: Greg Hurrell <email@hidden>)
 >Re: Objective-C 2.0 (From: Jason Jasmin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.