You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/06/15 13:21:29 UTC

[incubator-nuttx] 02/02: Include malloc.h instead of stdlib.h for mallinfo()

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit a607e6257fb5231aad78c88b0588ffb40763da18
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Mon Jun 15 15:02:25 2020 +0900

    Include malloc.h instead of stdlib.h for mallinfo()
    
    This change also removes the malloc.h inclusion in stdlib.h
    to break the build if there are still users of mallinfo() with stdlib.h.
---
 include/nuttx/kmalloc.h    | 1 +
 include/stdlib.h           | 1 -
 mm/mm_heap/mm_mallinfo.c   | 2 +-
 mm/umm_heap/umm_mallinfo.c | 2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/nuttx/kmalloc.h b/include/nuttx/kmalloc.h
index a8a3b04..89e8e08 100644
--- a/include/nuttx/kmalloc.h
+++ b/include/nuttx/kmalloc.h
@@ -28,6 +28,7 @@
 #include <nuttx/config.h>
 
 #include <sys/types.h>
+#include <malloc.h>
 #include <stdbool.h>
 #include <stdlib.h>
 
diff --git a/include/stdlib.h b/include/stdlib.h
index 502dc4c..6fbf196 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -30,7 +30,6 @@
 
 #include <sys/types.h>
 #include <errno.h>
-#include <malloc.h>
 #include <stdint.h>
 #include <limits.h>
 
diff --git a/mm/mm_heap/mm_mallinfo.c b/mm/mm_heap/mm_mallinfo.c
index d13ed66..37be0b1 100644
--- a/mm/mm_heap/mm_mallinfo.c
+++ b/mm/mm_heap/mm_mallinfo.c
@@ -39,7 +39,7 @@
 
 #include <nuttx/config.h>
 
-#include <stdlib.h>
+#include <malloc.h>
 #include <assert.h>
 #include <debug.h>
 
diff --git a/mm/umm_heap/umm_mallinfo.c b/mm/umm_heap/umm_mallinfo.c
index 39a4058..2176095 100644
--- a/mm/umm_heap/umm_mallinfo.c
+++ b/mm/umm_heap/umm_mallinfo.c
@@ -24,7 +24,7 @@
 
 #include <nuttx/config.h>
 
-#include <stdlib.h>
+#include <malloc.h>
 
 #include <nuttx/mm/mm.h>