ext4: malloc substitution - moved option definition and changed names
authorMichał Majewicz <mmajewicz@users.noreply.github.com>
Fri, 19 Aug 2016 10:31:13 +0000 (12:31 +0200)
committerMichał Majewicz <mmajewicz@users.noreply.github.com>
Fri, 19 Aug 2016 10:31:13 +0000 (12:31 +0200)
include/ext4_config.h
include/ext4_types.h

index 66f4c1949b1f72b1fa8d8f489b46a842e70b5e09..f42b6fcfce3c3481a8869d9d5fb98bc8b1f18d33 100644 (file)
@@ -149,6 +149,13 @@ extern "C" {
 #ifndef CONFIG_UNALIGNED_ACCESS
 #define CONFIG_UNALIGNED_ACCESS 0
 #endif
+
+/**@brief Switches use of malloc/free functions family
+ *        from standard library to user provided*/
+#ifndef CONFIG_USE_USER_MALLOC
+#define CONFIG_USE_USER_MALLOC 0
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index 23ea9008ac6e5d8476c0b8b8343da8e5fd88570c..dc1492c09e8de31d6559f9b89ecf79001030fe64 100644 (file)
@@ -1005,12 +1005,12 @@ struct jbd_sb {
 #endif
 
 
-#ifdef USE_OTHER_MALLOC
+#if CONFIG_USE_USER_MALLOC
 
-#define ext4_malloc  pool_malloc
-#define ext4_calloc  pool_calloc
-#define ext4_realloc pool_realloc
-#define ext4_free    pool_free
+#define ext4_malloc  user_malloc
+#define ext4_calloc  user_calloc
+#define ext4_realloc user_realloc
+#define ext4_free    user_free
 
 #else