> 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/mem__pool_8h_source.md).

# mem\_pool.h

[Go to the documentation of this file.](/adk-5.0-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md)

```cpp
 1 /****************************************************************************
 2 * Product: InFusion
 3 * Company: VeriFone
 4 * Author: GSS R&D Germany
 5 * Content: Memory pool
 6 ****************************************************************************/
 7 
 8 #ifndef MEM_POOL_H
 9 #define MEM_POOL_H
 10 
 11 #ifdef __cplusplus
 12 extern "C" {
 13 #endif
 14 
 15 #define TLV_UTIL_INTERFACE // NOTE: Do not set visibility("default") because export.map is used
 16 
 20 struct PoolNode {
 21  struct PoolNode *pxNext;
 22  unsigned uSize;
 23 };
 24 
 37 struct MemoryPool {
 38  struct PoolNode *pxFirst;
 39  void *pvStart;
 40  void *pvEnd;
 41 };
 42 
 46 struct MemoryPoolInfo {
 47  unsigned uSegments;
 48  unsigned uFree;
 49  unsigned uLargest;
 50 };
 51 
 52 TLV_UTIL_INTERFACE void vPoolInit(struct MemoryPool *pool, void *mem, unsigned size);
 53 TLV_UTIL_INTERFACE void *pvPoolMalloc(struct MemoryPool *pool, unsigned size);
 54 TLV_UTIL_INTERFACE void *pvPoolRealloc(struct MemoryPool *pool, void *memory, unsigned newsize);
 55 TLV_UTIL_INTERFACE void vPoolFree(struct MemoryPool *pool, void *memory);
 56 TLV_UTIL_INTERFACE void vPoolFreeAll(struct MemoryPool *pool);
 57 TLV_UTIL_INTERFACE void vPoolInfo(struct MemoryPool *pool, struct MemoryPoolInfo *info);
 58 
 59 #ifdef __cplusplus
 60 }
 61 #endif
 62 
 63 #ifndef TLV_UTIL_COMPILE
 64 # undef TLV_UTIL_INTERFACE
 65 #endif
 66 
 67 #endif // #ifndef MEM_POOL_H
 68 
```


---

# 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/mem__pool_8h_source.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.
