src/ucx/cx/allocator.h

changeset 504
c094afcdfb27
parent 490
d218607f5a7e
--- a/src/ucx/cx/allocator.h	Sun Jul 09 15:14:26 2023 +0200
+++ b/src/ucx/cx/allocator.h	Mon Jul 10 18:39:24 2023 +0200
@@ -133,6 +133,22 @@
 ) __attribute__((__nonnull__(2)));
 
 /**
+ * Re-allocate a previously allocated block and changes the pointer in-place, if necessary.
+ *
+ * \par Error handling
+ * \c errno will be set by realloc() on failure.
+ *
+ * @param mem pointer to the pointer to allocated block
+ * @param n the new size in bytes
+ * @return zero on success, non-zero on failure
+ */
+int cx_reallocate(
+        void **mem,
+        size_t n
+)
+__attribute__((__nonnull__));
+
+/**
  * Allocate \p n bytes of memory.
  *
  * @param allocator the allocator
@@ -169,7 +185,6 @@
 /**
  * Re-allocate a previously allocated block and changes the pointer in-place, if necessary.
  * This function acts like cxRealloc() using the pointer pointed to by \p mem.
- * On success, the pointer is changed to the new location (in case the
  *
  * \note Re-allocating a block allocated by a different allocator is undefined.
  *

mercurial