Article View: comp.sys.amiga.tech
Article #11817Re: AllocRemember & FreeRemember
From: Adam Levin CATS
Date: Wed, 15 Mar 1989 14:58
Date: Wed, 15 Mar 1989 14:58
34 lines
2368 bytes
2368 bytes
In article <9004@dasys1.UUCP> intern@dasys1.UUCP (intern ) writes:
>In article <1452@percival.UUCP> baer@percival.UUCP (Ken Baer) writes:
>>Yes, we use AllocRemember() all the time... The drawback is you have to
>>keep track of all your keys, which can get messy if you're not careful.
>> -Ken Baer.
>> // Hash Enterprises: When the Going gets Wierd, the Wierd go Professional
>
>Is it possible to deallocate only part of the memory that was allocated
>using a specific key? In other words, I want to use AllocRemember with a
>single key for all my allocations, so I could free up all the memory in one
>shot upon exit from my program. But during the course of my program execution,
>I would like to free up selected chunks of memory, (without freeing up all of
>it). Is that doable?
>
> Thanks,
> - Steve -
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Steve Faiwiszewski bang : {sun!hoptoad , cmcl2!phri} !dasys1!intern
> domain : intern@dasys1.UUCP
[duplicate .signature deleted]
Yes, it is possible. I wrote a routine to do this; I'll see if
we (C-A) want to release it.
To Ken Baer: You said you have to "keep track of all your keys".
Are you sure you are using AllocRemember correctly? You only need
to declare one key (one instance of a pointer to a Remember structure).
Then you keep passing the address of that key to subsequent calls to
AllocRemember, and finally to FreeRemember. If you are declaring a key
for each allocation, you are missing the whole benefit of AllocRemember.
--
Adam Keith Levin -- CATS Commodore-Amiga Technical Support
1200 Wilson Drive / West Chester, PA 19380 (215) 431-9180
BIX: aklevin UUCP: ...{amiga|rutgers|uunet}!cbmvax!adam
Technical Details
Message-ID:
<6288@cbmvax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cbmvax!adamReferences:
<1656@ardent.UUCP> <6782@killer.DALLAS.TX.US> <13592@cup.portal.com> <5705@cbmvax.UUCP> <1452@percival.UUCP> <9004@dasys1.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cbmvax!adam From: adam@cbmvax.UUCP (Adam Levin CATS) Newsgroups: comp.sys.amiga.tech Subject: Re: AllocRemember & FreeRemember Summary: It is possible Message-ID: <6288@cbmvax.UUCP> Date: 15 Mar 89 14:58:55 GMT References: <1656@ardent.UUCP> <6782@killer.DALLAS.TX.US> <13592@cup.portal.com> <5705@cbmvax.UUCP> <1452@percival.UUCP> <9004@dasys1.UUCP> Reply-To: adam@cbmvax.UUCP (Adam Levin CATS) Distribution: na Organization: Commodore Technology, West Chester, PA Lines: 34