Solar OS API - Memory - Functions

Free: a temporary state
until you will be used again...


You are here: Main API -> Memory API ->


API_Memory_Release PROC STDCALL
	USES	ecx,esi
	ARG	mem_handle:dword
	ARG	mem_size:dword

This function releases a previousely allocated memory block.

Arguments:

Argument Type Description
mem_handle dword The handle of the memory block to be released.
mem_size dword The size of the memory block to be released.
Size is in 4K blocks.

Returns:

Errors:

Remarks:

See Also

Articles

When running multiple instances of the same application one should save allocated memory handles and sizes into application's private variables. SOLAR OS and Private Variables

Sample code:



	;-----------------------------
	; alloc some memory
	;-----------------------------
	Call	API_Memory_Alocate,4		;get 16k
	mov	[my_mem_handle],eax		;store handle as we need it for Release
	mov	[my_mem_pointer],esi		;store pointer

...

	;-----------------------------
	;Release the memory
	;-----------------------------
	Call	API_Memory_Release,[my_mem_handle],4