summaryrefslogtreecommitdiff
path: root/src/sortedcache.c
Commit message (Collapse)AuthorAgeFilesLines
* Add missing license headersPatrick Steinhardt2017-07-031-0/+7
| | | | | Some implementation files were missing the license headers. This commit adds them.
* strmap: remove GIT__USE_STRMAP macroPatrick Steinhardt2017-02-171-2/+0
|
* khash: avoid using `kh_key`/`kh_val` as lvaluePatrick Steinhardt2017-02-171-2/+2
|
* khash: avoid using `kh_put` directlyPatrick Steinhardt2017-02-171-1/+1
|
* khash: avoid using `kh_key` directlyPatrick Steinhardt2017-02-171-1/+1
|
* khash: avoid using `kh_val`/`kh_value` directlyPatrick Steinhardt2017-02-171-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
* sortedcache: plug leaked file descriptorPatrick Steinhardt2016-11-151-0/+1
|
* sortedcache: check file size after opening the fileCarlos Martín Nieto2016-11-141-5/+13
| | | | | | | Checking the size before we open the file descriptor can lead to the file being replaced from under us when renames aren't quite atomic, so we can end up reading too little of the file, leading to us thinking the file is corrupted.
* pool: Simplify implementationVicent Marti2015-10-281-2/+3
|
* Remove extra semicolon outside of a functionStefan Widgren2015-02-151-1/+1
| | | | | Without this change, compiling with gcc and pedantic generates warning: ISO C does not allow extra ‘;’ outside of a function.
* Make our overflow check look more like gcc/clang'sEdward Thomson2015-02-131-4/+4
| | | | | | | | | 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.
* allocations: test for overflow of requested sizeEdward Thomson2015-02-121-1/+3
| | | | | Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
* Attribute file cache refactorRussell Belfer2014-04-171-3/+2
| | | | | | | This is a big refactoring of the attribute file cache to be a bit simpler which in turn makes it easier to enforce a lock around any updates to the cache so that it can be used in a threaded env. Tons of changes to the attributes and ignores code.
* Add diff threading tests and attr file cache locksRussell Belfer2014-04-171-3/+2
| | | | | | This adds a basic test of doing simultaneous diffs on multiple threads and adds basic locking for the attr file cache because that was the immediate problem that arose from these tests.
* Convert pqueue to just be a git_vectorRussell Belfer2014-02-041-1/+1
| | | | | | | | | | | | | This updates the git_pqueue to simply be a set of specialized init/insert/pop functions on a git_vector. To preserve the pqueue feature of having a fixed size heap, I converted the "sorted" field in git_vectors to a more general "flags" field so that pqueue could mix in it's own flag. This had a bunch of ramifications because a number of places were directly looking at the vector "sorted" field - I added a couple new git_vector helpers (is_sorted, set_sorted) so the specific representation of this information could be abstracted.
* Fix sortedcache docs and other feedbackRussell Belfer2013-08-221-4/+4
| | | | | | | This converts an internal lock from a write lock to a read lock where write isn't needed, and also clarifies some doc things about where various locks are acquired and how various APIs are intended to be used.
* Trying to fix Win32 warningsRussell Belfer2013-08-221-1/+1
|
* A bit of item alignment paranoiaRussell Belfer2013-08-221-4/+7
|
* Convert sortedcache to use rwlockRussell Belfer2013-08-221-66/+89
| | | | | This is the first use we have of pthread_rwlock_t in libgit2. Hopefully it won't cause any serious portability problems.
* No need to lock newly created tgt in copyRussell Belfer2013-08-211-4/+0
|
* Fix warnings when compiling without threadsRussell Belfer2013-08-211-0/+2
|
* Add sortedcache APIs to lookup index and removeRussell Belfer2013-08-211-0/+59
| | | | This adds two other APIs that I need to the sortedcache type.
* Add sorted cache data typeRussell Belfer2013-08-201-0/+297
This adds a convenient new data type for caching the contents of file in memory when each item in that file corresponds to a name and you need to both be able to lookup items by name and iterate over them in some sorted order. The new data type has locks in place to manage usage in a threaded environment.