Using zlib deflateBound() dynamically
问题 I have been looking at how to use deflateBound() dynamically and have not found exactly what I am looking for. I looked at the manual for zlip, examples included in library and found these here: Compression Libraries for ARM Cortex M3/4 Determine compressed/uncompressed buffer size for Z-lib in C zlib, deflate: How much memory to allocate? What I am missing is how to allocate after calling deflateBound(). E.g. this looks like it will cause problems z_stream defstream; uint8_t *outBuf=NULL;