Article View: comp.sys.mac
Article #16774Re: A Trivial Suggestion
From: dgold
Date: Mon, 15 Jun 1987 17:55
Date: Mon, 15 Jun 1987 17:55
21 lines
1588 bytes
1588 bytes
In article <1968@sphinx.uchicago.edu> fdot@sphinx.UUCP (Tom Lippincott) writes:
>...When I run flat out of memory,
>my heap expansion procedure ends up doing a longjmp back to the main
>event loop...
This is a bad thing to do. The Memory Manager (and the rest of the Toolbox)
expects to get control back from your GrowZone procedure. If you unwind
the stack as you are doing, there is no guarantee the system will continue
to operate correctly. You must signal failure by returning 0 from your
GrowZone, and cope with the error which the Memory Manager returns to its
caller. In order to prevent failures from Toolbox components which call
SysError when out of memory, you must arrange for your GrowZone to always
have memory available to give up for use by the Toolbox.
--
David Goldsmith
Apple Computer, Inc.
AppleLink: GOLDSMITH1
UUCP: {nsc,dual,sun,voder,ucbvax!mtxinu}!apple!dgold
CSNET: dgold@apple.CSNET, dgold%apple@CSNET-RELAY
BIX: dgoldsmith
Technical Details
Message-ID:
<1039@apple.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!lll-lcc!pyramid!voder!apple!dgoldReferences:
<869@apple.UUCP> <1499@midas.TEK.COM> <981@apple.UUCP> <1968@sphinx.uchicago.edu>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!lll-lcc!pyramid!voder!apple!dgold From: dgold@apple.UUCP Newsgroups: comp.sys.mac Subject: Re: A Trivial Suggestion Message-ID: <1039@apple.UUCP> Date: Mon, 15-Jun-87 13:55:38 EDT Article-I.D.: apple.1039 Posted: Mon Jun 15 13:55:38 1987 Date-Received: Wed, 17-Jun-87 01:32:15 EDT References: <869@apple.UUCP> <1499@midas.TEK.COM> <981@apple.UUCP> <1968@sphinx.uchicago.edu> Reply-To: dgold@apple.UUCP (David Goldsmith) Organization: Apple Computer Inc., Cupertino, USA Lines: 21