浏览代码

Added ability to replace the realloc() call with the dmmlib one.

Ioannis Koutras 13 年之前
父节点
当前提交
394d0fb84e
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      include/dmmlib/custom_realloc.h

+ 6 - 0
include/dmmlib/custom_realloc.h

@@ -52,5 +52,11 @@ void * custom_ahrealloc(allocator_t *allocator, heap_t *heap, void *ptr, size_t
 void * custom_realloc(void *ptr, size_t size);
 #endif /* WITH_MEMORY_SPACE_AWARENESS */
 
+#ifdef REPLACE_MALLOC
+
+#define realloc(ptr, size) custom_ahrealloc(NULL, NULL, ptr, size)
+
+#endif /* REPLACE_MALLOC */
+
 #endif /* CUSTOM_REALLOC_H */