@@ -1329,10 +1329,12 @@ #ifdef __cplusplus extern "C" { #endif /** * @brief Allocates memory for the specified number of items. + * + * To free the allocated memory, use `free()`. * * Throws @ref OFOutOfMemoryException if allocating failed and * @ref OFOutOfRangeException if the requested size exceeds the address space. * * @param count The number of items to allocate @@ -1344,10 +1346,12 @@ OF_WARN_UNUSED_RESULT; /** * @brief Allocates memory for the specified number of items and initializes it * with zeros. + * + * To free the allocated memory, use `free()`. * * Throws @ref OFOutOfMemoryException if allocating failed and * @ref OFOutOfRangeException if the requested size exceeds the address space. * * @param size The size of each item to allocate @@ -1358,10 +1362,12 @@ extern void *_Nullable of_calloc(size_t count, size_t size) OF_WARN_UNUSED_RESULT; /** * @brief Resizes memory to the specific number of items of the specified size. + * + * To free the allocated memory, use `free()`. * * If the pointer is NULL, this is equivalent to allocating memory. * If the size or number of items is 0, this is equivalent to freeing memory. * * Throws @ref OFOutOfMemoryException if allocating failed and @@ -1373,19 +1379,10 @@ * @return A pointer to the resized memory chunk */ extern void *_Nullable of_realloc(void *_Nullable pointer, size_t count, size_t size) OF_WARN_UNUSED_RESULT; -/** - * @brief Frees allocated memory. - * - * Does nothing if the pointer is NULL. - * - * @param pointer A pointer to the allocated memory - */ -extern void of_free(void *_Nullable pointer); - #ifdef OF_APPLE_RUNTIME extern void *_Null_unspecified objc_autoreleasePoolPush(void); extern void objc_autoreleasePoolPop(void *_Null_unspecified pool); # ifndef __OBJC2__ extern id _Nullable objc_constructInstance(Class _Nullable class_,