# FreeMemToMemLists

Returns memory to the free pool.

### Synopsis

`void FreeMemToMemLists( List *l, void *p, int32 size )`

### Description

The procedure returns a block of memory that was allocated with `AllocMemFromMemLists()` to the specified free memory pool (a list of memory lists).

Note: Unless you are trying to move memory from one memory pool to another, you should always free memory to the same pool that you obtained it from.

### Arguments

l
  A pointer to the memory pool (a list of memory lists) to which to return the memory block.

p
  A pointer to the memory to free. This value may be NULL, in which case this function just returns.

size
  Number of bytes to free. This must be the same size that was passed to AllocMemFromMemLists() to allocate the block. See FreeMem for additional information.

### Implementation

Folio call implemented in kernel folio V20.

### Associated Files

mem.h
  ANSI C Prototype

clib.lib
  ARM Link Library

### Notes

You can enable memory debugging in your application by compiling your entire project with the MEMDEBUG value defined on the compiler's command-line. Refer to the `CreateMemDebug()` function for more details.

### See Also

``AllocMem`(), AllocMemFromMemLists(), FreeMem()`

#