Article View: comp.sys.amiga.tech
Article #580AllocRemember() / FreeRemember help needed
From: protcoop
Date: Mon, 24 Jul 1989 12:42
Date: Mon, 24 Jul 1989 12:42
32 lines
1436 bytes
1436 bytes
I am trying to use AllocRemember/FreeRemember to keep track of all the
resources that I allocate, but it does not seem to work properly. Here
is what I have .
In the main function in one file I have ...
struct Remember *resources = (struct Remember*)NULL;
In a second file, I have the following:
extern struct Remember *resources;
.....
tgad = AllocRemember( resources, sizeof(struct Gadget), MEMF_CHIP );
In a third file:
extern struct Remember *resources;
......
if (resources)
{
printf("memory freed\n");
FreeRemember( resources, TRUE );
}
The printf never gets executed so the memory is not freed. The only
memory I allocate is for eight gadgets (as in above call). The system
loses 512 bytes each time. I am new to these functions and would
appreciate any help as to what I am doing wrong. Thank You.
Alan W. McKay | My opinions are mine, yours are yours. | Eat Food |
NEPEAN, Ont. | I in no way pretend to represent the | and |
613-763-8980 | the options of my employer. So there. | LIVE !! |
Technical Details
Message-ID:
<784@bnr-fos.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!bnr-vpa!bnr-fos!leibniz.uucp!protcoopShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!bnr-vpa!bnr-fos!leibniz.uucp!protcoop From: protcoop@leibniz.uucp Newsgroups: comp.sys.amiga.tech Subject: AllocRemember() / FreeRemember help needed Message-ID: <784@bnr-fos.UUCP> Date: 24 Jul 89 12:42:24 GMT Sender: news@bnr-fos.UUCP Reply-To: protcoop@leibniz.uucp () Organization: Bell-Northern Research, Ottawa, Canada Lines: 32