{This is a Unit MEMALLOC.PAS For use With the .VOC player...} Unit MemAlloc; { Purpose is to provide the ability to create (destroy) dynamic Variables } { without needing to reserve heap space at Compile time. } Interface Function Malloc(Var Ptr; Size : Word) : Word; { Allocate free memory and return a Pointer to it. The amount of memory { requested from Dos is calculated as (Size/4)+1 paraGraphs. if the { allocation is successful, the unTyped Var parameter Ptr will be populated { With the address of the allocated memory block, and the Function will return} { a zero result. Should the request to Dos fail, Ptr will be populated with { the value NIL, and the Function will return the appropriate Dos error code. } Function Dalloc(Var Ptr) : Word; { Deallocate the memory pointed to by the unTyped Var parameter Ptr } Function DosMemAvail : LongInt; { Return the size of the largest contiguous chuck of memory available For use } { --------------------------------------------------------------------------- } Implementation { --------------------------------------------------------------------------- } Function Malloc(Var Ptr; Size : Word) : Word; begin Inline( $8B/$46/ NIL then begin Inline( $B4/$49/ { mov ah,$49} $C4/$7E/