Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handles and Pointers [was: performance issues]



On 3/30/05 3:06 PM, steve zellers didst favor us with:

> Also, I saw another comment about using GetPtrSize - if at all possible, you
> should maintain the size of your allocation if you'll think you'll need it
> later.  GetPtrSize is rather inefficient.

While it's true that the call is less efficient than a lookup, this is
not an optimization that is worthwhile unless it's in a very tight loop
or other really time intensive/sensitive piece of code.

Also, unless you have a very time intensive/sensitive piece of code, it
is (imho) a waste of time to covert your code to malloc/free. Doesn't by
you anything except a few nanoseconds per call; instead you could spend
that time implementing a new feature or optimizing code that will make a
difference to end users.

If you are writing NEW code, then yea, I would say that using malloc/free
might be a good idea over the legacy calls where applicable.

Lane Roathe
President          Ideas From the Deep        <http://www.ifd.com>
___________________________________________________________________
Promoting World Peace through the use of Turn Signals in Video Games

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.