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: Determining reasonable memory use



On Sun, 30 Jan 2005 08:57:43 -0900, Mike Kluev <email@hidden> wrote:
> Those are all valid examples, but the worst thing that could happen
> in this "pessimistic" implementation is that the caller of malloc will
> get back NULL. Something the caller should be prepared and handle anyway.
> With the current "optimistic" implementation he will get back non null
> but may crash on attempt to write to that memory. The former, while not
> perfect is much closer to ideal than the latter, IMHO.

Huh? No one should EVER crash dereferencing a valid (non-NULL) pointer
returned by malloc. The worst case situation here is that the system may be
starved for physical pages to back the virtual pages the app is attempting
to access. Then the VM system goes into thrash mode and your system
performance goes all to heck. But it should NEVER crash.
-- 
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)


 _______________________________________________
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.