summaryrefslogtreecommitdiff
path: root/src/zstream.c
Commit message (Collapse)AuthorAgeFilesLines
* git_buf_grow_by: increase buf asize incrementallyEdward Thomson2015-02-121-2/+1
| | | | | Introduce `git_buf_grow_by` to incrementally increase the size of a `git_buf`, performing an overflow calculation on the growth.
* allocations: test for overflow of requested sizeEdward Thomson2015-02-121-0/+1
| | | | | Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
* zstream: grow based on used memory rather than allocatedCarlos Martín Nieto2014-04-261-1/+1
| | | | | | | | | | | | | | | When deflating data, we might need to grow the buffer. Currently we add a guess on top of the currently-allocated buffer size. When we re-use the buffer, it already has some memory allocated; adding to that means that we always grow the buffer regardless of how much we need to use. Instead, increase on top of the currently-used size. This still leaves us with the allocated size of the largest object we compress, but it's a minor pain compared to unbounded growth. This fixes #2285.
* Defer zstream NUL termination to endRussell Belfer2014-01-301-2/+5
| | | | | And don't terminate if there isn't space for it (since it's binary data, it's not worth a reallocation).
* Expand zstream tests and fix off-by-one errorRussell Belfer2014-01-301-1/+2
|
* Reorganize zstream API and fix wrap problemsRussell Belfer2014-01-301-44/+102
| | | | | | | | There were some confusing issues mixing up the number of bytes written to the zstream output buffer with the number of bytes consumed from the zstream input. This reorganizes the zstream API and makes it easier to deflate an arbitrarily large input while still using a fixed size output.
* Fix write_object.XTao2014-01-261-2/+1
|
* Packbuilder contains its own zstreamEdward Thomson2014-01-141-0/+5
|
* Refactor zlib for easier deflate streamingEdward Thomson2014-01-141-0/+90