diff --git a/doc/api/httplib_calloc.md b/doc/api/httplib_calloc.md index ef7042f4..153dd757 100644 --- a/doc/api/httplib_calloc.md +++ b/doc/api/httplib_calloc.md @@ -17,7 +17,7 @@ ### Description -The function `httplib_calloc()` tries to allocate a block of memory from the heap for an array elements with a specified size. If this succeeds, the function returns a pointer to the new block. Otherwise the value `NULL` is returned. If a callback function has been registered with the [`set_alloc_callback_func()`](set_alloc_callback_func.md) function, this function will be called to signal to the main application that a block of memory has been allocated. If a callback function has been registered and the allocation of memory fails, the value **0** is passed as the `current_bytes` parameter. +The function `httplib_calloc()` tries to allocate a block of memory from the heap for an array elements with a specified size. If this succeeds, the function returns a pointer to the new block. Otherwise the value `NULL` is returned. If a callback function has been registered with the [`httplib_set_alloc_callback_func()`](httplib_set_alloc_callback_func.md) function, this function will be called to signal to the main application that a block of memory has been allocated. If a callback function has been registered and the allocation of memory fails, the value **0** is passed as the `current_bytes` parameter. Due to the allocation of extra data space for tracking the memory allocation, the LibHTTP memory management functions including the `httplib_calloc()` function are incompatible with the memory allocation functions provided by the platform. Memory allocated with one set of functions can not be reallocated or freed by the others. Memory corruption or crashes may occur in that case. diff --git a/doc/api/httplib_free.md b/doc/api/httplib_free.md index 8c956a9a..8d341a90 100644 --- a/doc/api/httplib_free.md +++ b/doc/api/httplib_free.md @@ -14,7 +14,7 @@ ### Description -The function `httplib_free()` frees a block of memory which has been previously allocated by [`httplib_calloc()`](httplib_calloc.md), [`httplib_malloc()`](httplib_malloc.md) or [`httplib_realloc()`](httplib_realloc.md). If a callback function has been registered with the [`set_alloc_callback_func()`](set_alloc_callback_func.md) function, this function will be called to signal to the main application that a block of memory has been freed. The amount of bytes passed to the callback function is negative, to indacte that memory has been returned to the heap. +The function `httplib_free()` frees a block of memory which has been previously allocated by [`httplib_calloc()`](httplib_calloc.md), [`httplib_malloc()`](httplib_malloc.md) or [`httplib_realloc()`](httplib_realloc.md). If a callback function has been registered with the [`httplib_set_alloc_callback_func()`](httplib_set_alloc_callback_func.md) function, this function will be called to signal to the main application that a block of memory has been freed. The amount of bytes passed to the callback function is negative, to indacte that memory has been returned to the heap. Due to the allocation of extra data space for tracking the memory allocation, the LibHTTP memory management functions including the `httplib_free()` function are incompatible with the memory allocation functions provided by the platform. Memory allocated with one set of functions can not be reallocated or freed by the others. Memory corruption or crashes may occur in that case. diff --git a/doc/api/httplib_malloc.md b/doc/api/httplib_malloc.md index 626bf8cf..967cfd48 100644 --- a/doc/api/httplib_malloc.md +++ b/doc/api/httplib_malloc.md @@ -16,7 +16,7 @@ ### Description -The function `httplib_malloc()` tries to allocate a block of memory from the heap with a specified size. If this succeeds, the function returns a pointer to the new block. Otherwise the value `NULL` is returned. If a callback function has been registered with the [`set_alloc_callback_func()`](set_alloc_callback_func.md) function, this function will be called to signal to the main application that a block of memory has been allocated. If a callback function has been registered and the allocation of memory fails, the value **0** is passed as the `current_bytes` parameter. +The function `httplib_malloc()` tries to allocate a block of memory from the heap with a specified size. If this succeeds, the function returns a pointer to the new block. Otherwise the value `NULL` is returned. If a callback function has been registered with the [`httplib_set_alloc_callback_func()`](httplib_set_alloc_callback_func.md) function, this function will be called to signal to the main application that a block of memory has been allocated. If a callback function has been registered and the allocation of memory fails, the value **0** is passed as the `current_bytes` parameter. Due to the allocation of extra data space for tracking the memory allocation, the LibHTTP memory management functions including the `httplib_malloc()` function are incompatible with the memory allocation functions provided by the platform. Memory allocated with one set of functions can not be reallocated or freed by the others. Memory corruption or crashes may occur in that case. diff --git a/doc/api/httplib_realloc.md b/doc/api/httplib_realloc.md index 858a63b1..ef9f44cf 100644 --- a/doc/api/httplib_realloc.md +++ b/doc/api/httplib_realloc.md @@ -21,7 +21,7 @@ The function `httplib_realloc()` tries to change the size of an existing allocat If the `ptr` parameter is NULL, the function `httplib_realloc()` is equivalent to [`httplib_malloc();`](httplib_malloc.md). If the parameter `size` is **0**, the function `httplib_realloc()` will be equal to [`httplib_free();`](httplib_free.md). -If a callback function has been registered with the [`set_alloc_callback_func()`](set_alloc_callback_func.md) function, this function will be called to signal to the main application that a block of memory has been allocated. If a callback function has been registered and the allocation of memory fails, the value **0** is passed as the `current_bytes` parameter. Please note that the `current_bytes` parameter passed to the callback function can both be a positive and negative value. A positive value indicates that the size of the memory block has increased while a negative value signals a decrease in the allocated size. +If a callback function has been registered with the [`httplib_set_alloc_callback_func()`](httplib_set_alloc_callback_func.md) function, this function will be called to signal to the main application that a block of memory has been allocated. If a callback function has been registered and the allocation of memory fails, the value **0** is passed as the `current_bytes` parameter. Please note that the `current_bytes` parameter passed to the callback function can both be a positive and negative value. A positive value indicates that the size of the memory block has increased while a negative value signals a decrease in the allocated size. Due to the allocation of extra data space for tracking the memory allocation, the LibHTTP memory management functions including the `httplib_realloc()` function are incompatible with the memory allocation functions provided by the platform. Memory allocated with one set of functions can not be reallocated or freed by the others. Memory corruption or crashes may occur in that case.