From 5f5e143a50600ac059a993a49c79d711e92aa8e5 Mon Sep 17 00:00:00 2001 From: Kevin Yonan Date: Tue, 25 Jun 2019 09:21:49 -0700 Subject: [PATCH] Updating documentation on MemPool_CleanUp function --- mempool_README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mempool_README.md b/mempool_README.md index c80603d78..ec91f49c1 100644 --- a/mempool_README.md +++ b/mempool_README.md @@ -94,7 +94,7 @@ Explanation & Usage: To deallocate memory back to the pool, there's also two functions: ```c void MemPool_Free(struct MemPool *mempool, void *ptr); - void MemPool_CleanUp(struct MemPool *mempool, void *ptrref); + void MemPool_CleanUp(struct MemPool *mempool, void **ptrref); ``` `MemPool_Free` will deallocate the pointer data back to the memory pool. @@ -106,9 +106,8 @@ Explanation & Usage: `MemPool_CleanUp` instead takes a pointer to an allocated pointer and then calls `MemPool_Free` for that pointer and then sets it to NULL. ```c // deallocates i and sets the pointer to NULL. - MemPool_CleanUp(&pool, &i); + MemPool_CleanUp(&pool, (void **)&i); // i is now NULL. - ``` Using `MemPool_CleanUp` is basically a shorthand way of doing this code: