Forum unknown
· Modula-2
#BenchMark NEW/DISPOSE
5 messages in this thread
I need help from anyone with knowledge of BenchMark Modula-2. I'm trying to
compile a few source modules which I've downloaded from a BBS. These modules
are looking for the standard functions NEW and DISPOSE. These do not seem to
be standard modules in the BenchMark M2. I've devised a work-around using
ALLOCATE and DEALLOCATE, but I still am having a few problems. Any help would
be appreciated.
The BenchMark package follows the rules of the latest Modula-2 revisions
(can't remember the #), which eliminated NEW and DISPOSE. Using the ADos
functions AllocMem() and FreeMem() is the best way to work around your
problems. Their syntax is similar.
-Dave
The BenchMark package follows the rules of the latest Modula-2 revisions
(can't remember the #), which eliminated NEW and DISPOSE. Using the ADos
functions AllocMem() and FreeMem() is the best way to work around your
problems. Their syntax is similar.
-Dave
Try something like:
VAR p : POINTER TO something; BEGIN
ALLOCATE(p, TSIZE(something));
.
.
.
DEALLOCATE(p, TSIZE(something)); END……
That should be identical. The NEW and DISPOSE functions just alleviated the
problem of getting the allocation size. The dropping of them just simplfied
matters for the most part.
Try something like:
VAR p : POINTER TO something; BEGIN
ALLOCATE(p, TSIZE(something));
.
.
.
DEALLOCATE(p, TSIZE(something)); END……
That should be identical. The NEW and DISPOSE functions just alleviated the
problem of getting the allocation size. The dropping of them just simplfied
matters for the most part.