home *** CD-ROM | disk | FTP | other *** search
- PRODUCT : TURBO PASCAL NUMBER : 341
- VERSION : 2.0xx
- OS : 16-Bit
- DATE : October 9, 1986
-
- TITLE : RELEASE PROCEDURE UPDATE
-
- This procedure is a work-around for a problem in version 2.0 of
- Turbo Pascal that does not correctly release space on the heap
- when a pointer is allocated with New and deallocated with
- Release.
-
- The following routine should be called instead of Release to free
- space on the heap.
-
- type
- IntPtr = ^integer;
-
- procedure ReleaseHeap(OldHeapPtr : IntPtr);
-
- begin
- FreeMem(OldHeapPtr, ((Seg(HeapPtr^) - Seg(OldHeapPtr^)) shl 4)
- +
- (Ofs(HeapPtr^) - Ofs(OldHeapPtr^)));
- end; { ReleaseHeap }
-