Update mempool_README.md

This commit is contained in:
Kevin Yonan 2019-06-24 19:54:17 -07:00 committed by GitHub
parent 125782324f
commit 6d320de48a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@ Explanation & Usage:
We have two constructor functions:
```c
struct MemPool MemPool_Create(size_t bytes);
struct MemPool MemPool_FromBuffer(size_t bytes, void *buf);
struct MemPool MemPool_FromBuffer(void *buf, size_t bytes);
```
To which you create a `struct MemPool` instance and give the function a max amount of memory you wish or require for your data.
@ -66,7 +66,7 @@ Explanation & Usage:
Alternatively, if you're not in a position to use any kind of dynamic allocation from the operating system, you have the option to utilize an existing buffer as memory for the mempool:
```c
char mem[64000];
struct MemPool pool = MemPool_FromBuffer(sizeof mem, mem);
struct MemPool pool = MemPool_FromBuffer(mem, sizeof mem);
```
To allocate from the pool, we have two functions: