util: Heap-allocate 256K zlib buffer
authorJory Pratt <anarchy@gentoo.org>
Mon, 10 Jun 2019 18:48:02 +0000 (11:48 -0700)
committerMatt Turner <mattst88@gmail.com>
Wed, 19 Jun 2019 19:16:18 +0000 (12:16 -0700)
commitfd7b7f14d857f96cf3b2e9d8405dbbfa30dc261a
tree586e9ff10505421f12f2bae3fb661da9902bb796
parent9c19d07b1cdcd22ced0f4e1c147e496b6ff5cf23
util: Heap-allocate 256K zlib buffer

The disk cache code tries to allocate a 256 Kbyte buffer on the stack.
Since musl only gives 80 Kbyte of stack space per thread, this causes a
trap.

See https://wiki.musl-libc.org/functional-differences-from-glibc.html#Thread-stack-size

(In musl-1.1.21 the default stack size has increased to 128K)

[mattst88]: Original author unknown, but I think this is small enough
            that it is not copyrightable.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/util/disk_cache.c