|
@@ -28,7 +28,7 @@
|
|
#include <dmmlib/heap.h>
|
|
#include <dmmlib/heap.h>
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Try to change the size of an allocation
|
|
+ * Try to change the size of an allocation on a specific allocator and heap
|
|
*
|
|
*
|
|
* \param allocator The pointer to the allocator who manages the block.
|
|
* \param allocator The pointer to the allocator who manages the block.
|
|
* \param heap The pointer to the heap who manages the block.
|
|
* \param heap The pointer to the heap who manages the block.
|
|
@@ -40,7 +40,10 @@
|
|
*/
|
|
*/
|
|
void * custom_ahrealloc(allocator_t *allocator, heap_t *heap, void *ptr, size_t size);
|
|
void * custom_ahrealloc(allocator_t *allocator, heap_t *heap, void *ptr, size_t size);
|
|
|
|
|
|
-#ifndef WITH_MEMORY_SPACE_AWARENESS
|
|
+
|
|
|
|
+
|
|
|
|
+/* In case stdlib.h is used, there is no need to redeclare realloc() */
|
|
|
|
+#ifndef __malloc_and_calloc_defined
|
|
/**
|
|
/**
|
|
* Try to change the size of an allocation
|
|
* Try to change the size of an allocation
|
|
* \param ptr The pointer to the data part of the original memory block.
|
|
* \param ptr The pointer to the data part of the original memory block.
|
|
@@ -49,14 +52,7 @@ void * custom_ahrealloc(allocator_t *allocator, heap_t *heap, void *ptr, size_t
|
|
* \return The pointer to the data part of the memory block which
|
|
* \return The pointer to the data part of the memory block which
|
|
* has the new, desired size.
|
|
* has the new, desired size.
|
|
*/
|
|
*/
|
|
-void * custom_realloc(void *ptr, size_t size);
|
|
+void * realloc(void *ptr, size_t size);
|
|
-#endif /* WITH_MEMORY_SPACE_AWARENESS */
|
|
+#endif /* __malloc_and_calloc_defined */
|
|
-
|
|
|
|
-#ifdef REPLACE_MALLOC
|
|
|
|
-
|
|
|
|
-#define realloc(ptr, size) custom_ahrealloc(NULL, NULL, ptr, size)
|
|
|
|
-
|
|
|
|
-#endif /* REPLACE_MALLOC */
|
|
|
|
|
|
|
|
#endif /* CUSTOM_REALLOC_H */
|
|
#endif /* CUSTOM_REALLOC_H */
|
|
-
|
|
|