[PATCH] sandbox: get malloc_size from .config

Antony Pavlov antonynpavlov at gmail.com
Tue Jan 20 16:02:39 PST 2015


Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
---
 arch/sandbox/os/Makefile | 2 ++
 arch/sandbox/os/common.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/os/Makefile b/arch/sandbox/os/Makefile
index 2e65be5..537f848 100644
--- a/arch/sandbox/os/Makefile
+++ b/arch/sandbox/os/Makefile
@@ -8,6 +8,8 @@ else
 CPPFLAGS = $(patsubst %,-I$(srctree)/%include,$(machdirs))
 endif
 
+CPPFLAGS += -DCONFIG_MALLOC_SIZE=$(CONFIG_MALLOC_SIZE)
+
 CFLAGS := -Wall
 NOSTDINC_FLAGS :=
 
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 4123938..0854fb5 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -285,7 +285,7 @@ int main(int argc, char *argv[])
 {
 	void *ram;
 	int opt, ret, fd;
-	int malloc_size = 8 * 1024 * 1024;
+	int malloc_size = CONFIG_MALLOC_SIZE;
 	char str[6];
 	int fdno = 0, envno = 0, option_index = 0;
 
-- 
2.1.4




More information about the barebox mailing list