diff -r d06aa9db0408 -r 197450c2b0b3 docs/Writerside/topics/buffer.h.md --- a/docs/Writerside/topics/buffer.h.md Fri Dec 05 16:36:10 2025 +0100 +++ b/docs/Writerside/topics/buffer.h.md Fri Dec 05 16:38:17 2025 +0100 @@ -129,12 +129,14 @@ void cxBufferShrink(CxBuffer *buffer, size_t reserve); ``` -The functions `cxBufferReserve()` and `cxBufferMinimumCapacity()` guarantee a buffer capacity of _at least_ `capacity`. -The difference is, that `cxBufferReserve()` will not increase the capacity beyond the specified `capacity`, -while `cxBufferMinimumCapacity()` will grow the capacity in powers of two until the system's page size is reached. +The function `cxBufferMinimumCapacity()` guarantees a buffer capacity of _at least_ `capacity`. +It will grow the capacity in powers of two until the system's page size is reached. Then, the new capacity will be a multiple of the page size. The function returns non-zero if increasing the capacity was attempted unsuccessfully. +The function `cxBufferReserve()`, on the other hand, will reallocate the buffer's space to match exactly the requested `capacity` +and the contents are truncated if required. + You should use `cxBufferReserve()` when you know precisely the required capacity beforehand and `cxBufferMinimumCapacity()` when it is likely that the buffer needs to regrow soon.