Retrieves the size of a memory block allocated by AllocMem.

SizeOfMem(nAddress)

Parameters

nAddress

A pointer to a memory block returned from AllocMem.

Return Value

If the function succeeds, the return value is the requested size of the allocated memory block, in bytes.

If the function fails, the return value is -1.

If the nAddress parameter refers to a heap allocation that is not in the library heap the behavior of the SizeOfMem function is undefined.

See Also

Reference

AllocHGlobal
AllocMem
AllocMemTo
AMemBlocks
CompactMem
FreeHGlobal
FreeMem
FreePMem
FreeRefArray
LockHGlobal
ReAllocHGlobal
ReAllocMem
UnlockHGlobal
ValidateMem

Used WinApi functions

HeapSize