summaryrefslogtreecommitdiff
path: root/src/pack-objects.c
Commit message (Collapse)AuthorAgeFilesLines
* Honor `core.fsyncObjectFiles`ethomson/fsyncEdward Thomson2017-03-021-0/+4
|
* oidmap: remove GIT__USE_OIDMAP macroPatrick Steinhardt2017-02-171-2/+0
|
* khash: avoid using macro magic to get return addressPatrick Steinhardt2017-02-171-1/+1
|
* khash: avoid using `kh_key`/`kh_val` as lvaluePatrick Steinhardt2017-02-171-2/+2
|
* khash: avoid using `kh_put` directlyPatrick Steinhardt2017-02-171-2/+2
|
* khash: avoid using `kh_val`/`kh_value` directlyPatrick Steinhardt2017-02-171-3/+3
|
* khash: avoid using `kh_clear` directlyPatrick Steinhardt2017-02-171-1/+1
|
* khash: avoid using `kh_get` directlyPatrick Steinhardt2017-02-171-1/+1
|
* khash: avoid using `kh_end` directlyPatrick Steinhardt2017-02-171-1/+1
|
* khash: use `git_map_exists` where applicablePatrick Steinhardt2017-02-171-2/+1
|
* pack: report revwalk errorEtienne Samson2017-01-131-1/+1
|
* giterr_set: consistent error messagesEdward Thomson2016-12-291-5/+5
| | | | | | | | Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
* packbuilder: `size_t` all the thingsEdward Thomson2016-07-241-63/+85
| | | | | | | | After 1cd65991, we were passing a pointer to an `unsigned long` to a function that now expected a pointer to a `size_t`. These types differ on 64-bit Windows, which means that we trash the stack. Use `size_t`s in the packbuilder to avoid this.
* Merge pull request #3223 from ethomson/applyEdward Thomson2016-06-251-14/+21
|\ | | | | Reading patch files
| * patch: formatting cleanupsEdward Thomson2016-05-261-1/+1
| |
| * zstream: offer inflating, `git_zstream_inflatebuf`Edward Thomson2016-05-261-1/+1
| | | | | | | | Introduce `git_zstream_inflatebuf` for simple uses.
| * delta: refactor git_delta functions for consistencyEdward Thomson2016-05-261-13/+20
| | | | | | | | | | Refactor the git_delta functions to have consistent naming and parameters with the rest of the library.
* | threads: split up OS-dependent thread codePatrick Steinhardt2016-06-201-1/+1
|/
* pack-objects: fix memory leak on overflowPatrick Steinhardt2016-03-111-1/+3
|
* pack-objects: return early when computing write order failsPatrick Steinhardt2016-02-231-4/+2
| | | | | | | | | | | The function `compute_write_order` may return a `NULL`-pointer when an error occurs. In such cases we jump to the `done`-label where we try to clean up allocated memory. Unfortunately we try to deallocate the `write_order` array, though, which may be NULL here. Fix this error by returning early instead of jumping to the `done` label. There is no data to be cleaned up anyway.
* pack-objects: check realloc in try_delta with GITERR_CHECK_ALLOCPatrick Steinhardt2016-02-231-2/+4
|
* pack-objects: fix memory leak in packbuilder_configPatrick Steinhardt2016-02-091-4/+7
|
* pack-objects: fix memory leak in compute_write_orderPatrick Steinhardt2016-02-091-0/+1
|
* pool: Simplify implementationVicent Marti2015-10-281-2/+1
|
* Remove extra semicolon outside of a functionStefan Widgren2015-07-311-1/+1
| | | | | Without this change, compiling with gcc and pedantic generates warning: ISO C does not allow extra ‘;’ outside of a function.
* packbuilder: report progress during deltificationcmn/pack-objects-reportCarlos Martín Nieto2015-05-131-0/+28
| | | | | | | | This is useful to send to the client while we're performing the work. The reporting function has a force parameter which makes sure that we do send out the message of 100% completed, even if this comes before the next udpate window.
* packbuilder: introduce git_packbuilder_insert_recur()Carlos Martín Nieto2015-03-171-0/+36
| | | | | | This function recursively inserts the given object and any referenced ones. It can be thought of as a more general version of the functions to insert a commit or tree.
* pack-objects: fill a packbuilder from a walkCarlos Martín Nieto2015-03-111-1/+242
| | | | | | | | | | | Most use-cases for the object packer communicate in terms of commits which each side has. We already have an object to specify this relationship between commits, namely git_revwalk. By knowing which commits we want to pack and which the other side already has, we can perform similar optimisations to git, by marking each tree as interesting or uninteresting only once, and not sending those trees which we know the other side has.
* Reorder some khash declarationsCarlos Martín Nieto2015-03-111-0/+2
| | | | | | Keep the definitions in the headers, while putting the declarations in the C files. Putting the function definitions in headers causes them to be duplicated if you include two headers with them.
* pack-objects: unlock the cache on integer overflowEdward Thomson2015-02-131-4/+5
|
* Make our overflow check look more like gcc/clang'sEdward Thomson2015-02-131-4/+3
| | | | | | | | | Make our overflow checking look more like gcc and clang's, so that we can substitute it out with the compiler instrinsics on platforms that support it. This means dropping the ability to pass `NULL` as an out parameter. As a result, the macros also get updated to reflect this as well.
* Introduce git__add_sizet_overflow and friendsEdward Thomson2015-02-121-2/+2
| | | | | Add some helper functions to check for overflow in a type-specific manner.
* Use `size_t` to hold size of arraysEdward Thomson2015-02-121-1/+9
| | | | | | Use `size_t` to hold the size of arrays to ease overflow checking, lest we check for overflow of a `size_t` then promptly truncate by packing the length into a smaller type.
* overflow checking: don't make callers set oomEdward Thomson2015-02-121-3/+1
| | | | | | Have the ALLOC_OVERFLOW testing macros also simply set_oom in the case where a computation would overflow, so that callers don't need to.
* git__*allocarray: safer realloc and mallocEdward Thomson2015-02-121-9/+5
| | | | | | | | Introduce git__reallocarray that checks the product of the number of elements and element size for overflow before allocation. Also introduce git__mallocarray that behaves like calloc, but without the `c`. (It does not zero memory, for those truly worried about every cycle.)
* allocations: test for overflow of requested sizeEdward Thomson2015-02-121-3/+19
| | | | | Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
* Win32: Fix object::cache::threadmania test on x64Philip Kelley2014-06-071-1/+1
|
* Merge pull request #2334 from libgit2/rb/fix-2333Russell Belfer2014-05-121-0/+1
|\ | | | | Be more careful with user-supplied buffers
| * Be more careful with user-supplied buffersrb/fix-2333Russell Belfer2014-05-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | This adds in missing calls to `git_buf_sanitize` and fixes a number of places where `git_buf` APIs could inadvertently write NUL terminator bytes into invalid buffers. This also changes the behavior of `git_buf_sanitize` to NUL terminate a buffer if it can and of `git_buf_shorten` to do nothing if it can. Adds tests of filtering code with zeroed (i.e. unsanitized) buffer which was previously triggering a segfault.
* | Merge pull request #2188 from libgit2/cmn/config-snapshotRussell Belfer2014-05-121-2/+4
|\ \ | |/ |/| Configuration snapshotting
| * repository: introduce a convenience config snapshot methodcmn/config-snapshotCarlos Martín Nieto2014-05-071-5/+2
| | | | | | | | | | | | Accessing the repository's config and immediately taking a snapshot of it is a common operation, so let's provide a convenience function for it.
| * Use config snapshottingCarlos Martín Nieto2014-04-181-3/+8
| | | | | | | | | | This way we can assume we have a consistent view of the config situation when we're looking up remote, branch, pack-objects, etc.
* | pack-objects: always write out the status in write_one()cmn/pack-objects-memoryCarlos Martín Nieto2014-04-261-0/+1
| | | | | | | | Make sure we set the output parameter to a value.
* | Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-211-1/+1
|/
* pack-objects: free memory safelyCarlos Martín Nieto2014-03-041-10/+17
| | | | | | | | | A few fixes have accumulated in this area which have made the freeing of data a bit muddy. Make sure to free the data only when needed and once. When we are going to write a delta to the packfile, we need to free the data, otherwise leave it. The current version of the code mixes up the checks for po->data and po->delta_data.
* Reorganize zstream API and fix wrap problemsRussell Belfer2014-01-301-11/+6
| | | | | | | | 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.
* Some fixes for Windows x64 warningsRussell Belfer2014-01-301-1/+1
|
* Fix write_object.XTao2014-01-261-3/+5
|
* Packbuilder contains its own zstreamEdward Thomson2014-01-141-5/+4
|
* Packbuilder stream deflate instead of one-shotEdward Thomson2014-01-141-64/+81
|