From 3235369e74c9207d5487f8597518c2e4cd5ff898 Mon Sep 17 00:00:00 2001 From: Kevin Yonan Date: Mon, 24 Jun 2019 19:55:16 -0700 Subject: [PATCH] Update and rename objpool README.txt to objpool_README.md --- objpool README.txt => objpool_README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) rename objpool README.txt => objpool_README.md (92%) diff --git a/objpool README.txt b/objpool_README.md similarity index 92% rename from objpool README.txt rename to objpool_README.md index d47a37052..3ab2b3086 100644 --- a/objpool README.txt +++ b/objpool_README.md @@ -23,7 +23,7 @@ Explanation & Usage: We have two constructor functions: ```c struct ObjPool ObjPool_Create(size_t objsize, size_t len); - struct ObjPool ObjPool_FromBuffer(size_t objsize, size_t len, void *buf); + struct ObjPool ObjPool_FromBuffer(void *buf, size_t objsize, size_t len); ``` To which you create a `struct ObjPool` instance and give the size of your object and how many objects for the pool to hold. @@ -43,7 +43,7 @@ Explanation & Usage: Alternatively, if for any reason that you cannot use dynamic memory allocation, you have the option of using an existing buffer for the object pool: ```c struct vec3D vectors[100]; - struct ObjPool vector_pool = ObjPool_FromBuffer(sizeof(struct vec3D), 1[&vector] - 0[&vector], vectors); + struct ObjPool vector_pool = ObjPool_FromBuffer(vectors, sizeof(struct vec3D), 1[&vector] - 0[&vector]); ``` The buffer MUST be aligned to the size of `size_t` AND the object size must not be smaller than a `size_t` either. @@ -72,5 +72,3 @@ Explanation & Usage: ```c ObjPool_Free(&vector_pool, origin), origin = NULL; ``` - - You may also optionally back your