 |
 |
duh: NSZone docs?
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Location: Malaysia
Status:
Offline
|
|
I'm sure this is just an "Of Course" question, but I'm trying to find Cocoa (obj-C) docs for the NSZone object. The only place I could find class documentation is in Project Builder (and apple web site) Cocoa Reference Documentation. They have Application Kit and Foundation. NSZone is discussed in several other classes (see NSObject docs), but not actually documented anywhere that I could find. Any help?
---gralem
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
Foundation Docs, scroll down to protocols. Click "Functions." Then click "Zones."
Took me about 15 seconds to find with the help of <a href="http://homepage.mac.com/hoshi_takanori/cocoa-browser/" target="_blank">Cocoa Browser</a>.
In general, you can also look at the header files. A look at NSZone.h makes it quite evident that it's an object that isn't defined. This makes sense, since I would expect (looking at the things related to it) that an NSZone is nothing more than a block of memory for you to use for an object. I've never done any research on NSZone before. But this would be my guess. Based on that, everything found in those two places makes sense.
<small>[ 07-05-2002, 10:56 AM: Message edited by: Detrius ]</small>
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2000
Location: Raleigh, NC
Status:
Offline
|
|
I don't think NSZone actually functions as designed in 10.1.x. Supposedly it's going to work again in 10.2. It's never actually worked since the NeXTStep days, so it would be nice to have it back.
The point of NSZone is that it allows you to define multiple memory allocation heaps in your address space so that you have finer control over locality of reference. If you know that a certain group of objects are going to be referenced together and dealloced together, then by allocating them from the same zone makes them tend to live in the same memory pages, which is more VM efficient.
Of course, in 10.1, no matter which zone you tell an object to allocate from, it always comes from the default zone right now, so there is no advantage.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by mlaster:
<strong>I don't think NSZone actually functions as designed in 10.1.x. Supposedly it's going to work again in 10.2. It's never actually worked since the NeXTStep days, so it would be nice to have it back.
The point of NSZone is that it allows you to define multiple memory allocation heaps in your address space so that you have finer control over locality of reference. If you know that a certain group of objects are going to be referenced together and dealloced together, then by allocating them from the same zone makes them tend to live in the same memory pages, which is more VM efficient.
Of course, in 10.1, no matter which zone you tell an object to allocate from, it always comes from the default zone right now, so there is no advantage.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Always interesting to learn something new...
And always nice to see knowledgeable Mac programers in my home state... The only Mac users I tend to find around here are web developers... how boring... (sorry, I do 3d algorithm design)
[edit: typo... duh]
<small>[ 07-11-2002, 01:51 AM: Message edited by: Detrius ]</small>
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|