Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > duh: NSZone docs?

duh: NSZone docs?
Thread Tools
Dedicated MacNNer
Join Date: Nov 2000
Location: Malaysia
Status: Offline
Reply With Quote
Jul 5, 2002, 09:13 AM
 
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
Reply With Quote
Jul 5, 2002, 09:49 AM
 
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
Reply With Quote
Jul 9, 2002, 09:05 AM
 
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
Reply With Quote
Jul 11, 2002, 12:49 AM
 
</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
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:58 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2