summaryrefslogtreecommitdiff
path: root/src/hashtable.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename git_khash_str to git_strmap, etc.Russell Belfer2012-04-251-328/+0
| | | | | | This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to `git_oidmap`, and deletes `git_hashtable` from the tree, plus adds unit tests for `git_strmap`.
* Adding stash to hashtable implementationRussell Belfer2012-04-251-41/+102
| | | | | | | | | | Adding a small stash of nodes with key conflicts has been demonstrated to greatly increase the efficiency of a cuckoo hashtable. See: http://research.microsoft.com/pubs/73856/stash-full.9-30.pdf for more details.
* Continue error conversionRussell Belfer2012-03-141-1/+6
| | | | | | | This converts blob.c, fileops.c, and all of the win32 files. Also, various minor cleanups throughout the code. Plus, in testing the win32 build, I cleaned up a bunch (although not all) of the warnings with the 64-bit build.
* Convert attr and other files to new errorsRussell Belfer2012-03-141-29/+33
| | | | | | | | This continues to add other files to the new error handling style. I think the only real concerns here are that there are a couple of error return cases that I have converted to asserts, but I think that it was the correct thing to do given the new error style.
* error-handling: On-disk config file backendVicent Martí2012-03-091-2/+2
| | | | | | | | | | | | | | | Includes: - Proper error reporting when encountering syntax errors in a config file (file, line number, column). - Rewritten `config_write`, now with 99% less goto-spaghetti - Error state in `git_filebuf`: filebuf write functions no longer need to be checked for error returns. If any of the writes performed on a buffer fail, the last call to `git_filebuf_commit` or `git_filebuf_hash` will fail accordingly and set the appropiate error message. Baller!
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* hashtable: add remove2 to retrieve the value that was removedCarlos Martín Nieto2012-01-191-1/+2
|
* Add APIs for git attributesRussell Belfer2011-12-201-0/+14
| | | | | | | | | This adds APIs for querying git attributes. In addition to the new API in include/git2/attr.h, most of the action is in src/attr_file.[hc] which contains utilities for dealing with a single attributes file, and src/attr.[hc] which contains the implementation of the APIs that merge all applicable attributes files.
* global: Properly use `git__` memory wrappersVicent Marti2011-10-281-5/+5
| | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* Cleanup legal dataVicent Marti2011-09-191-21/+3
| | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* cleanup: remove trailing spacesKirill A. Shutemov2011-07-011-5/+5
| | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* hashtable: Reword errorsVicent Marti2011-05-231-1/+1
|
* hashtable.c: Move to new error handling mechanismJakob Pfender2011-05-231-2/+2
|
* Debug assertion when using an initialized hashtableVicent Marti2011-03-151-0/+6
|
* Add extra methods to the new Hashtable implementationVicent Marti2011-03-031-1/+13
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Rewrite git_hashtable internalsVicent Marti2011-02-221-146/+141
| | | | | | | | | | | | | | | | The old hash table with chained buckets has been replaced by a new one using Cuckoo hashing, which offers guaranteed constant lookup times. This should improve speeds on most use cases, since hash tables in libgit2 are usually used as caches where the objects are stored once and queried several times. The Cuckoo hash implementation is based off the one in the Basekit library [1] for the IO language, but rewritten to support an arbritrary number of hashes. We currently use 3 to maximize the usage of the nodes pool. [1]: https://github.com/stevedekorte/basekit/blob/master/source/CHash.c Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Split object methods from repository.cVicent Marti2011-01-031-1/+0
| | | | | | All the relevant git_object methods have been moved to object.c Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Add support for manually freeing repo objectsVicent Marti2010-08-121-0/+31
| | | | | | | | A new method 'git_repository_object_free' allows to manually force the freeing of a repository object, even though they are still automatically managed by the repository and don't need to be freed by the user. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Redesigned the walking/object lookup interfaceVicent Marti2010-08-121-0/+218
The old 'git_revpool' object has been removed and split into two distinct objects with separate functionality, in order to have separate methods for object management and object walking. * A new object 'git_repository' does the high-level management of a repository's objects (commits, trees, tags, etc) on top of a 'git_odb'. Eventually, it will also manage other repository attributes (e.g. tag resolution, references, etc). See: src/git/repository.h * A new external method 'git_repository_lookup(repo, oid, type)' has been added to the 'git_repository' API. All object lookups (git_XXX_lookup()) are now wrappers to this method, and duplicated code has been removed. The method does automatic type checking and returns a generic 'git_revpool_object' that can be cast to any specific object. See: src/git/repository.h * The external methods for object parsing of repository objects (git_XXX_parse()) have been removed. Loading objects from the repository is now managed through the 'lookup' functions. These objects are loaded with minimal information, and the relevant parsing is done automatically when the user requests any of the parsed attributes through accessor methods. An attribute has been added to 'git_repository' in order to force the parsing of all the repository objects immediately after lookup. See: src/git/commit.h See: src/git/tag.h See: src/git/tree.h * The previous walking functionality of the revpool is now found in 'git_revwalk', which does the actual revision walking on a repository; the attributes when walking through commits in a database have been decoupled from the actual commit objects. This increases performance when accessing commits during the walk and allows to have several 'git_revwalk' instances working at the same time on top of the same repository, without having to load commits in memory several times. See: src/git/revwalk.h * The old 'git_revpool_table' has been renamed to 'git_hashtable' and now works as a generic hashtable with support for any kind of object and custom hash functions. See: src/hashtable.h * All the relevant unit tests have been updated, renamed and grouped accordingly. Signed-off-by: Vicent Marti <tanoku@gmail.com>