]> git.proxmox.com Git - libgit2.git/commit - src/tree.c
write_tree: use shared buffer for writing trees
authorMichael Tesch <mitesch@microsoft.com>
Tue, 9 Aug 2016 16:23:19 +0000 (12:23 -0400)
committerMichael Tesch <mitesch@microsoft.com>
Mon, 12 Dec 2016 15:46:05 +0000 (10:46 -0500)
commit87aaefe20b2e2fad8f0b8b236d1c23ce9ec5340f
treecdb39442af47ecfd98c09342d365ac16bf6f7641
parent97e57e8770132d61ff2c36bee2de2c7ac5c9d609
write_tree: use shared buffer for writing trees

The function to write trees allocates a new buffer for each tree.
This causes problems with performance when performing a lot
of actions involving writing trees, e.g. when doing many merges.
Fix the issue by instead handing in a shared buffer, which is then
re-used across the calls without having to re-allocate between
calls.
include/git2/tree.h
src/tree.c