diff -r 4a72c47226f4 -r 2ad0cf0f314b docs/Writerside/topics/allocator.h.md --- a/docs/Writerside/topics/allocator.h.md Sat Feb 15 16:36:29 2025 +0100 +++ b/docs/Writerside/topics/allocator.h.md Sat Feb 15 17:43:21 2025 +0100 @@ -17,17 +17,17 @@ void *cxMalloc(const CxAllocator *allocator, size_t n); void *cxCalloc(const CxAllocator *allocator, - size_t nmemb, size_t size); + size_t nmemb, size_t size); void *cxRealloc(const CxAllocator *allocator, void *mem, size_t n); void *cxReallocArray(const CxAllocator *allocator, void *mem, - size_t nmemb, size_t size); + size_t nmemb, size_t size); int cxReallocate(const CxAllocator *allocator, void **mem, size_t n); int cxReallocateArray(const CxAllocator *allocator, void **mem, - size_t nmemb, size_t size); + size_t nmemb, size_t size); void cxFree(const CxAllocator *allocator, void *mem); @@ -124,21 +124,21 @@ and the second one is called _advanced_ destructor. The only difference is that you can pass additional custom `data` to an advanced destructor function. -Destructor functions play a vital role in deep de-allocations. -Another scenarios, besides destroying elements in a collection, are the de-allocation of objects -stored in a [memory pool](mempool.h.md) or de-allocations of deeply nested [JSON](json.h.md) objects. +Destructor functions play a vital role in deep deallocations. +Another scenarios, besides destroying elements in a collection, are the deallocation of objects +stored in a [memory pool](mempool.h.md) or deallocations of deeply nested [JSON](json.h.md) objects. > Destructor functions are not to be confused with `free()`-like functions. > The fundamental differences are that > * it is not safe to pass `NULL` to a destructor function -> * a destructor may only de-allocate the contents inside an object but not the object itself, depending on context +> * a destructor may only deallocate the contents inside an object but not the object itself, depending on context > {style="note"} > For example, when you are using a [list](list.h.md) that stores elements directly, a destructor function > assigned to that collection may only destroy the element's contents but must not deallocate the element's memory. > On the other hand, when the list is storing just pointers to the elements, you _may_ want the destructor -> function to also de-allocate the element's memory when the element is removed from that list. +> function to also deallocate the element's memory when the element is removed from that list.