Update mempool_README.md

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

View File

@ -1,4 +1,4 @@
Raylib Memory Pool lRaylib Memory Pool
By Kevin 'Assyrianic' Yonan @ https://github.com/assyrianic By Kevin 'Assyrianic' Yonan @ https://github.com/assyrianic
About: About:
@ -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: 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 ```c
char mem[64000]; char mem[64000];
struct MemPool pool = MemPool_FromBuffer(sizeof mem, &mem[0]); struct MemPool pool = MemPool_FromBuffer(sizeof mem, mem);
``` ```
To allocate from the pool, we have two functions: To allocate from the pool, we have two functions:
@ -160,3 +160,4 @@ Explanation & Usage:
```c ```c
size_t MemPool_MemoryRemaining(const struct MemPool mempool); size_t MemPool_MemoryRemaining(const struct MemPool mempool);
``` ```