Igor Delovski Board Forum Index Igor Delovski Board
My Own Personal Slashdot!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Memory

 
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Carbon
Mac Carbon  
Author Message
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Tue Apr 03, 2007 9:25 pm    Post subject: Memory Reply with quote

ADC: TN2130 - Memory Allocation Recommendations on Mac OS X

"The Macintosh Memory Manager provides in MacMemory.h the four memory
allocation functions NewPtr, NewPtrClear, NewHandle, and NewHandleClear.
... On Mac OS X, those four functions eventually call the C library function
malloc with a thin overhead.

Use DisposePtr to deallocate the memory allocated by NewPtr or NewPtrClear
and you can use SetPtrSize to resize the allocated memory (beware, even
on Mac OS X, SetPtrSize may fail)."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Tue Apr 10, 2007 11:10 pm    Post subject: Reply with quote

Must-see documnt at ADC: Ownership Policy

"Applications using Core Foundation constantly access and create and dispose
of objects. In order to ensure that you do not leak memory, Core Foundation
defines rules for getting and creating objects."


Same place: The Create Rule

"The object-creation functions have “Create” embedded in the name and
the object-duplication functions have “Copy” embedded in the name. If you
own an object, it is your responsibility to relinquish ownership using
CFRelease() when you have finished with it."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Thu Mar 04, 2010 2:14 am    Post subject: Reply with quote

so - OSX API Question: Where does BlockZero live?

"BlockZero is a function that seems to zero a block of memory. It lives in
CoreServices and is defined in MacMemory.h. The problem is that the fun-
ction is unavailable to apps being compiled as 64bit (which is the default;
hence my problem)."
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Carbon All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Delovski.hr
Powered by php-B.B. © 2001, 2005 php-B.B. Group