> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md).

# mem\_pool.h

[Data Structures](#nested-classes) | [Macros](#define-members) | [Functions](#func-members)

This graph shows which files directly or indirectly include this file:

![](/files/1tKTjEZb6ZJNzquTVJul)

[Go to the source code of this file.](/adk-5.0-programmers-guide/mem__pool_8h_source.md)

|                 |                                            |
| --------------- | ------------------------------------------ |
| Data Structures |                                            |
| struct          | [PoolNode](#struct_pool_node)              |
| struct          | [MemoryPool](#struct_memory_pool)          |
| struct          | [MemoryPoolInfo](#struct_memory_pool_info) |

|         |                                                            |
| ------- | ---------------------------------------------------------- |
| Macros  |                                                            |
| #define | [TLV\_UTIL\_INTERFACE](#ae809ada9194252356dbaa46410dfbb39) |

|                                                                    |                                                                                                                                                             |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Functions                                                          |                                                                                                                                                             |
| [TLV\_UTIL\_INTERFACE](#ae809ada9194252356dbaa46410dfbb39) void    | [vPoolInit](#a1cf0544df5dadc299bcc60e8e3c3961e) (struct [MemoryPool](#struct_memory_pool) \*pool, void \*mem, unsigned size)                                |
| [TLV\_UTIL\_INTERFACE](#ae809ada9194252356dbaa46410dfbb39) void \* | [pvPoolMalloc](#ad61c1fd291939dc423bfd58a1b455c10) (struct [MemoryPool](#struct_memory_pool) \*pool, unsigned size)                                         |
| [TLV\_UTIL\_INTERFACE](#ae809ada9194252356dbaa46410dfbb39) void \* | [pvPoolRealloc](#a9ff3d2a2c810e692ad344650ced21427) (struct [MemoryPool](#struct_memory_pool) \*pool, void \*memory, unsigned newsize)                      |
| [TLV\_UTIL\_INTERFACE](#ae809ada9194252356dbaa46410dfbb39) void    | [vPoolFree](#afbd27e75ab44ed7dfd909c64756dc869) (struct [MemoryPool](#struct_memory_pool) \*pool, void \*memory)                                            |
| [TLV\_UTIL\_INTERFACE](#ae809ada9194252356dbaa46410dfbb39) void    | [vPoolFreeAll](#aa1871b4604a6614f379abb30e1613f47) (struct [MemoryPool](#struct_memory_pool) \*pool)                                                        |
| [TLV\_UTIL\_INTERFACE](#ae809ada9194252356dbaa46410dfbb39) void    | [vPoolInfo](#a468509547e43de5621df45470c15d70a) (struct [MemoryPool](#struct_memory_pool) \*pool, struct [MemoryPoolInfo](#struct_memory_pool_info) \*info) |

***

### DataStructure Documentation <a href="#data-structure-documentation" id="data-structure-documentation"></a>

### PoolNode <a href="#struct_pool_node" id="struct_pool_node"></a>

struct PoolNode

structure for managing free chunks of memory

#### Date

4.12.2006

#### Author

M. Meixner

Collaboration diagram for PoolNode:

![Collaboration graph](/files/iSY9cxgysMolioEmnzLU)

\[[legend](/adk-5.0-programmers-guide/graph_legend.md)]

|                                         |        |                                                                  |
| --------------------------------------- | ------ | ---------------------------------------------------------------- |
| Data Fields                             |        |                                                                  |
| struct [PoolNode](#struct_pool_node) \* | pxNext | pointer to next free memory chunk                                |
| unsigned                                | uSize  | size of this [PoolNode](#struct_pool_node) i.e. this free memory |

### MemoryPool <a href="#struct_memory_pool" id="struct_memory_pool"></a>

struct MemoryPool

Memory pool structure.

The memory pool allows to allocate/free memory from a given region of memory. Using such a pool has some interesting properties:

* By releasing the memory of the pool itself all allocations that have been made from the pool are released.
* The allocatable size is limited to the size of the pool.
* Memory fragmentation is limited to the pool.

#### Seealso <a href="#see-also" id="see-also"></a>

[vPoolInit()](#a1cf0544df5dadc299bcc60e8e3c3961e), [pvPoolMalloc()](#ad61c1fd291939dc423bfd58a1b455c10),[pvPoolRealloc()](#a9ff3d2a2c810e692ad344650ced21427),[vPoolFree()](#afbd27e75ab44ed7dfd909c64756dc869)

#### Date

4.12.2006

#### Author

M. Meixner

Collaboration diagram for MemoryPool:

![Collaboration graph](/files/oeNmKQFntthi3aoRn4Sc)

\[[legend](/adk-5.0-programmers-guide/graph_legend.md)]

|                                         |         |                                                              |
| --------------------------------------- | ------- | ------------------------------------------------------------ |
| Data Fields                             |         |                                                              |
| void \*                                 | pvEnd   | end of the managed memory region (first addres past the end) |
| void \*                                 | pvStart | start of the managed memory region                           |
| struct [PoolNode](#struct_pool_node) \* | pxFirst | pointer to the first free memory chunk                       |

### MemoryPoolInfo <a href="#struct_memory_pool_info" id="struct_memory_pool_info"></a>

struct MemoryPoolInfo

statistics information of free memory

#### Date

8.2.2007

#### Author

M. Meixner

|             |           |                                                |
| ----------- | --------- | ---------------------------------------------- |
| Data Fields |           |                                                |
| unsigned    | uFree     | number of free bytes in the pool               |
| unsigned    | uLargest  | size of the largest segment in the memory pool |
| unsigned    | uSegments | number of segments of free memory              |

### MacroDefinition Documentation <a href="#macro-definition-documentation" id="macro-definition-documentation"></a>

### TLV\_UTIL\_INTERFACE <a href="#ae809ada9194252356dbaa46410dfbb39" id="ae809ada9194252356dbaa46410dfbb39"></a>

\#define TLV\_UTIL\_INTERFACE

### FunctionDocumentation <a href="#function-documentation" id="function-documentation"></a>

### pvPoolMalloc() <a href="#ad61c1fd291939dc423bfd58a1b455c10" id="ad61c1fd291939dc423bfd58a1b455c10"></a>

\[TLV\_UTIL\_INTERFACE]\(#ae809ada9194252356dbaa46410dfbb39) void\\\* pvPoolMalloc

### pvPoolRealloc() <a href="#a9ff3d2a2c810e692ad344650ced21427" id="a9ff3d2a2c810e692ad344650ced21427"></a>

\[TLV\_UTIL\_INTERFACE]\(#ae809ada9194252356dbaa46410dfbb39) void\\\* pvPoolRealloc

### vPoolFree() <a href="#afbd27e75ab44ed7dfd909c64756dc869" id="afbd27e75ab44ed7dfd909c64756dc869"></a>

\[TLV\_UTIL\_INTERFACE]\(#ae809ada9194252356dbaa46410dfbb39) void vPoolFree

### vPoolFreeAll() <a href="#aa1871b4604a6614f379abb30e1613f47" id="aa1871b4604a6614f379abb30e1613f47"></a>

\[TLV\_UTIL\_INTERFACE]\(#ae809ada9194252356dbaa46410dfbb39) void vPoolFreeAll

### vPoolInfo() <a href="#a468509547e43de5621df45470c15d70a" id="a468509547e43de5621df45470c15d70a"></a>

\[TLV\_UTIL\_INTERFACE]\(#ae809ada9194252356dbaa46410dfbb39) void vPoolInfo

### vPoolInit() <a href="#a1cf0544df5dadc299bcc60e8e3c3961e" id="a1cf0544df5dadc299bcc60e8e3c3961e"></a>

\[TLV\_UTIL\_INTERFACE]\(#ae809ada9194252356dbaa46410dfbb39) void vPoolInit


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
