Category : Pascal Source Code
Archive   : PASS_ALL.ZIP
Filename : TI343.ASC

 
Output of file : TI343.ASC contained in archive : PASS_ALL.ZIP









PRODUCT : TURBO PASCAL NUMBER : 343
VERSION : 2.00
OS : CP/M-80
DATE : November 4, 1986 PAGE : 1/1
TITLE : RELEASE UPDATE




This is a work-around for a problem in the Release procedure of
version 2.00 of Turbo Pascal. Use this procedure instead of
Release.


type
IntPtr = ^integer;

procedure NewRelease(OldHeapPtr : IntPtr);

var
I : integer;
X, Y : real;

begin
if HeapPtr < 0 then
X := 65536.0 + HeapPtr
else
X := HeapPtr;
I := Addr(OldHeapPtr^);
if I < 0 then
Y := 65536.0 + I
else
Y := I;
I := Round(X - Y);
FreeMem(OldHeapPtr, I);
end; { NewRelease }