# GetMemTrackSize

Get the size of a block of memory allocated with MEMTYPE_TRACKSIZE.

### Synopsis

`int32 GetMemTrackSize( const void *p )`

### Description

This function returns the size that was used to allocate a block of memory. The block of memory must have been allocated using the MEMTYPE_TRACKSIZE flag, otherwise this function will return garbage.

### Arguments

p
  Pointer obtained from a system memory allocation routine. The block of memory must have been allocated using the MEMTYPE_TRACKSIZE flag, otherwise the value returned by this function will be random.

### Return Value

The function returns the size, in bytes, of the memory block. This size corresponds to the size provided to the system memory allocation routine when the block was first allocated.

### Implementation

Folio call implemented in kernel folio V24.

### Associated Files

mem.h
  ANSI C Prototype

clib.lib
  ARM Link Library

### Caveats

This function will not return the correct value for allocations made using MEMTYPE_STARTPAGE and using a private MemList structure. Allocations done with `AllocMem()` will always work, since they use the task's memory lists and not any private MemList.

### See Also

``AllocMem`(), FreeMem()`

#