CompuServe Thread

Forum unknown · Modula-2

#BenchMark NEW/DISPOSE

5 messages in this thread
#126344From: V. HilliardMay 24, 1988 2:35 PM
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.
#126518From: David CzayaMay 25, 1988 10:06 AM
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
#126518From: David CzayaMay 25, 1988 10:06 AM
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
#126836From: Erv ThompsonMay 26, 1988 11:50 PM
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.
#126836From: Erv ThompsonMay 26, 1988 11:50 PM
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.