From: Guus Sliepen Date: Sun, 18 Feb 2018 14:38:12 +0000 (+0100) Subject: Reduce memory allocations due to zlib's uncompress(). X-Git-Tag: release-1.1pre16~24 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=6be453fc63da9f87455b5e579cb686f95fa92102;hp=6be453fc63da9f87455b5e579cb686f95fa92102;p=tinc Reduce memory allocations due to zlib's uncompress(). Everytime uncompress() is called, zlib allocates some buffer on the heap and frees it again. When compression is enabled, this is the biggest source of memory allocations in tinc. Instead of using this function, use inflate(), which can store its state in a z_stream variable, which avoids (re)allocating memory for every packet received. This issue was found thanks to heaptrack. ---