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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8130d7e21 zlib:Support using Kconfig to control memory usage in zlib
8130d7e21 is described below

commit 8130d7e2113af34acb4b013280db7030d04a8d9a
Author: anjiahao <anjia...@xiaomi.com>
AuthorDate: Fri Mar 29 11:23:37 2024 +0800

    zlib:Support using Kconfig to control memory usage in zlib
    
    Signed-off-by: anjiahao <anjia...@xiaomi.com>
---
 system/zlib/Kconfig  | 14 ++++++++++++++
 system/zlib/Makefile |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/system/zlib/Kconfig b/system/zlib/Kconfig
index ac52c197d..637fbff61 100644
--- a/system/zlib/Kconfig
+++ b/system/zlib/Kconfig
@@ -90,4 +90,18 @@ config UTILS_UNZIP_STACKSIZE
 
 endif # UTILS_UNZIP
 
+config LIB_ZLIB_MAX_WBITS
+  int "Zlib max wbits"
+  default 15
+  range 8 15
+  ---help---
+    Default windowBits. memory usage (1 << (windowBits+2)) bytes.
+
+config LIB_ZLIB_MAX_MEM_LEVEL
+  int "Zlib max mem level"
+  default 8
+  range 1 9
+  ---help---
+    Default memLevel. memory usage (1 << (memLevel+9)) bytes.
+
 endif # LIB_ZLIB
diff --git a/system/zlib/Makefile b/system/zlib/Makefile
index fa8266ffb..b750f78b2 100644
--- a/system/zlib/Makefile
+++ b/system/zlib/Makefile
@@ -85,4 +85,7 @@ PROGNAME += zlib_infcover_test
 MAINSRC += zlib/test/infcover.c
 endif
 
+CFLAGS += -DMAX_WBITS=$(CONFIG_LIB_ZLIB_MAX_WBITS)
+CFLAGS += -DMAX_MEM_LEVEL=$(CONFIG_LIB_ZLIB_MAX_MEM_LEVEL)
+
 include $(APPDIR)/Application.mk

Reply via email to