home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!soda.berkeley.edu!cliffwd
- From: cliffwd@soda.berkeley.edu (Cliff Draper)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: AllocRemember - how does it work?
- Date: 3 Jan 1993 04:58:20 GMT
- Organization: U.C. Berkeley, CS Undergraduate Association
- Lines: 23
- Message-ID: <1i5rpcINNj4j@agate.berkeley.edu>
- References: <d2hacker.724952539@dtek.chalmers.se>
- NNTP-Posting-Host: soda.berkeley.edu
-
-
- The AutoDocs describe this Intuition command. But if your AutoDocs arn't
- handy....
-
- struct Remember *remkey=NULL;
-
- char *block1, *block2;
-
- if (!(block1=(char *) AllocRemember(&remkey, BLOCK1SIZE, MEMF_CLEAR)))
- fail("insufficient memory");
- if (!(block2=(char *) AllocRemember(&remkey, BLOCK2SIZE, MEMF_CLEAR)))
- fail("insufficient memory");
- /* use the 2 blocks as if you got them from AllocMem() */
- fail("all done");
- ...
- /* and within fail() */
- FreeRemember(*remkey, TRUE);
-
- You might also need some includes, but there's the bones.
- fail() can be called before, in-between, or after the AllocRember()'s and
- all memory allocated through that one key will be released.
-
- -Cliff
-