home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!fuug!funic!sauna.cs.hut.fi!news.cs.hut.fi!s37732v
- From: s37732v@snakemail.hut.fi (Markus Juhani Aalto)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: AllocRemember - how does it work?
- Date: 03 Jan 93 10:23:45 GMT
- Organization: Helsinki University of Technology, Finland
- Lines: 38
- Distribution: inet
- Message-ID: <S37732V.93Jan3122345@lk-hp-18.hut.fi>
- References: <d2hacker.724952539@dtek.chalmers.se> <1i5rpcINNj4j@agate.berkeley.edu>
- NNTP-Posting-Host: lk-hp-18.hut.fi
- In-reply-to: cliffwd@soda.berkeley.edu's message of 3 Jan 1993 04:58:20 GMT
-
- In article <1i5rpcINNj4j@agate.berkeley.edu> cliffwd@soda.berkeley.edu (Cliff Draper) writes:
-
- 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
-
- FreeRemember should propably be FreeRemember(remkey,TRUE);
-
- --
-
-
- **************************************************************************
- * Markus Aalto | Helsinki University of Technology *
- * | *
- * EMail: s37732v@vipunen.hut.fi | Faculty of Electric Engineering *
- * Fax: 358-0-8746991 (Sometimes) | *
- * | Undergraduate in Computer Science *
- **************************************************************************
-
-