zlib: track memory allocated by zlib
Provide a custom memory allocator for zlib, and track memory allocated by the library with it.
Right now this “only” makes reported external memory usage (much) more accurate and protects against zlib memory leaks, but it generally will enable us to give more accurate memory usage statistics for zlib.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines