- 12 Jan, 2016 1 commit
-
-
Add a new build flag to disable the pool allocator and pass all git_pool_malloc calls straight to git__malloc
Ross Delinger committed
-
- 13 Nov, 2015 1 commit
-
-
Vicent Marti committed
-
- 28 Oct, 2015 3 commits
-
-
Vicent Marti committed
-
Vicent Marti committed
-
Vicent Marti committed
-
- 13 Feb, 2015 3 commits
-
-
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.
Edward Thomson committed -
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.
Edward Thomson committed -
Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
Edward Thomson committed
-
- 20 Jan, 2015 1 commit
-
-
Jacques Germishuys committed
-
- 05 Dec, 2014 1 commit
-
-
Will Stamper committed
-
- 25 Sep, 2014 1 commit
-
-
Jacques Germishuys committed
-
- 30 Jun, 2014 1 commit
-
-
To make sure that items returned from pool allocations are aligned on nice boundaries, this rounds up all pool allocation sizes to a multiple of 8. This adds a small amount of overhead to each item. The rounding up could be made optional with an extra parameter to the pool initialization that turned on rounding only for pools where item alignment actually matters, but I think for the extra code and complexity that would be involved, that it makes sense just to burn a little bit of extra memory and enable this all the time.
Russell Belfer committed
-
- 20 May, 2014 1 commit
-
-
Use size_t for page size, instead of long. Check result of sysconf. Use size_t for page offset so no cast to size_t (second arg to p_mmap). Use mod instead div/mult pair, so no cast to size_t is necessary.
Albert Meltzer committed
-
- 13 Dec, 2013 2 commits
-
-
Ok, scrap the previous commit. This is the right overflow check that takes care of 64 bit overflow **and** 32-bit overflow, which needs to be considered because the pool malloc can only allocate 32-bit elements in one go.
Vicent Marti committed -
Note that `git_pool_strdup` cannot really return any error codes, because the pool doesn't set errors on OOM. The only place where `giterr_set_oom` is called is in `git_pool_strndup`, in a conditional check that is always optimized away. `n + 1` cannot be zero if `n` is unsigned because the compiler doesn't take wraparound into account. This check has been removed altogether because `size_t` is not particularly going to overflow.
Vicent Marti committed
-
- 11 Dec, 2013 1 commit
-
-
This adds giterr_user_cancel to return GIT_EUSER and clear any error message that is sitting around. As a result of using that in places, we need to be more thorough with capturing errors that happen inside a callback when used internally. To help with that, this also adds giterr_capture and giterr_restore so that when we internally use a foreach-type function that clears errors and converts them to GIT_EUSER, it is easier to restore not just the return value, but the actual error message text.
Russell Belfer committed
-
- 29 May, 2013 1 commit
-
-
Edward Thomson committed
-
- 15 Mar, 2013 1 commit
-
-
Vicent Marti committed
-
- 14 Mar, 2013 2 commits
-
-
This adds a git_pool_freelist_item struct that makes it a little easier to follow what's going on with the pool free list block management code. It is functionally neutral.
Russell Belfer committed -
This updates the tree iterator internals to be more efficient. The tree_iterator_entry objects are now kept as pointers that are allocated from a git_pool, so that we may use git__tsort_r for sorting (which is better than qsort, given that the tree is likely mostly ordered already). Those tree_iterator_entry objects now keep direct pointers to the data they refer to instead of keeping indirect index values. This simplifies a lot of the data structure traversal code. This also adds bsearch to find the start item position for range- limited tree iterators, and is more explicit about using git_path_cmp instead of reimplementing it. The git_path_cmp changed a bit to make it easier for tree_iterators to use it (but it was barely being used previously, so not a big deal). This adds a git_pool_free_array function that efficiently frees a list of pool allocated pointers (which the tree_iterator keeps). Also, added new tests for the git_pool free list functionality that was not previously being tested (or used).
Russell Belfer committed
-
- 19 Jul, 2012 1 commit
-
-
A diff that is created with a NULL options parameter could result in a NULL prefix string, but diff merge was unconditionally strdup'ing it. I added a test to replicate the issue and then a new method that does the right thing with NULL values.
Russell Belfer committed
-
- 14 Jun, 2012 1 commit
-
- 07 Jun, 2012 1 commit
-
-
Chris Young committed
-
- 26 Apr, 2012 1 commit
-
-
Russell Belfer committed
-
- 25 Apr, 2012 3 commits
-
-
This removes the custom paged allocator from revwalk and replaces it with a `git_pool`.
Russell Belfer committed -
This converts the git attr related code (including ignores) and the git diff related code (and implicitly the status code) to use `git_pools` for storing strings. This reduces the number of small blocks allocated dramatically.
Russell Belfer committed -
This adds a `git_pool` object that can do simple paged memory allocation with free for the entire pool at once. Using this, you can replace many small allocations with large blocks that can then cheaply be doled out in small pieces. This is best used when you plan to free the small blocks all at once - for example, if they represent the parsed state from a file or data stream that are either all kept or all discarded. There are two real patterns of usage for `git_pools`: either for "string" allocation, where the item size is a single byte and you end up just packing the allocations in together, or for "fixed size" allocation where you are allocating a large object (e.g. a `git_oid`) and you generally just allocation single objects that can be tightly packed. Of course, you can use it for other things, but those two cases are the easiest.
Russell Belfer committed
-