Skip to content

Commit

Permalink
zlib:Support using Kconfig to control memory usage in zlib
Browse files Browse the repository at this point in the history
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
  • Loading branch information
anjiahao1 committed Oct 15, 2024
1 parent 8e7d6ca commit 11ba73a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions system/zlib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions system/zlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 11ba73a

Please sign in to comment.