Allocates memory blocks.
Kernel.bdh
Malloc (in nSize : number ): number;
Pointer to the allocated space. Unless Silk Performer is able to allocate the specified amount of memory, the simulation is aborted.
Parameter | Description |
---|---|
nSize | Size of allocated space in bytes |
dcltrans transaction TMalloc var nBuffer: number; begin // allocate a buffer of 10 bytes nBuffer := Malloc(10); write("memory successfully allocated"); writeln; // free memory referenced by nBuffer Free(nBuffer); write("memory released"); writeln; end TMalloc;
memory successfully allocated memory released