Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-11-01pack: `__object_header` always returns unsigned valuesVicent Marti
2013-11-01Fix warning on win64Linquize
2013-10-04pack: move the object header function hereCarlos Martín Nieto
2013-08-14sha1_lookup: do not use the "experimental" lookup modeVicent Marti
2013-07-25Close p->mwf.fd only if necessarySven Strickroth
This fixes a regression introduced in revision 9d2f841a5d39fc25ce722a3904f6ebc9aa112222. Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-07-15pack: fix memory leak in error pathRémi Duraffort
2013-06-01Mutex init can failRussell Belfer
It is obviously quite a serious problem if this happens, but mutex initialization can fail and we should detect it. It's a bit like a memory allocation failure, in that you're probably pretty screwed if this occurs, but at least we'll catch it.
2013-06-01Zero memory for major objects before freeingRussell Belfer
By zeroing out the memory when we free larger objects (i.e. those that serve as collections of other data, such as repos, odb, refdb), I'm hoping that it will be easier for libgit2 bindings to find errors in their object management code.
2013-05-02Switch to index_version as "git_pack_file is ready" flagCarlos Martín Nieto
We use p->index_map.data to check whether the struct has been set up and all the information about the index is stored there. This variable gets set up halfway through the setup process, however, and a thread can come along and use fields that haven't been written to yet. Crucially, pack_entry_find_offset() needs to read the index version (which is written after index_map) to know the offset and stride length to pass to sha1_entry_pos(). If these values are wrong, assertions in it will fail, as it will be reading bogus data. Make index_version the last field to be written and switch from using p->index_map.data to p->index_version as "git_pack_file is ready" flag as we can use it to know if every field has been written.
2013-05-02Revert "Protect sha1_entry_pos call with mutex"Carlos Martín Nieto
This reverts commit 8c535f3f6879c6796d8107d7eb80dd8b2105621b.
2013-05-02Protect sha1_entry_pos call with mutexRussell Belfer
There is an occasional assertion failure in sha1_entry_pos from pack_entry_find_index when running threaded. Holding the mutex around the code that grabs the index_map data and processes it makes this assertion failure go away.
2013-05-02Add extra locking around packfile openRussell Belfer
We were still seeing a few issues in threaded access to packs. This adds extra locks around the opening of the mwindow to avoid a different race.
2013-04-30Make git_oid_cmp public and add git_oid__cmpRussell Belfer
2013-04-22Consolidate packfile allocation furtherRussell Belfer
Rename git_packfile_check to git_packfile_alloc since it is now being used more in that capacity. Fix the various places that use it. Consolidate some repeated code in odb_pack.c related to the allocation of a new pack_backend.
2013-04-22Make indexer use shared packfile open codeRussell Belfer
The indexer was creating a packfile object separately from the code in pack.c which was a problem since I put a call to git_mutex_init into just pack.c. This commit updates the pack function for creating a new pack object (i.e. git_packfile_check()) so that it can be used in both places and then makes indexer.c use the shared initialization routine. There are also a few minor formatting and warning message fixes.
2013-04-22Further threading fixesRussell Belfer
This builds on the earlier thread safety work to make it so that setting the odb, index, refdb, or config for a repository is done in a threadsafe manner with minimized locking time. This is done by adding a lock to the repository object and using it to guard the assignment of the above listed pointers. The lock is only held to assign the pointer value. This also contains some minor fixes to the other work with pack files to reduce the time that locks are being held to and fix an apparently memory leak.
2013-04-22Add mutex around mapping and unmapping pack filesRussell Belfer
When I was writing threading tests for the new cache, the main error I kept running into was a pack file having it's content unmapped underneath the running thread. This adds a lock around the routines that map and unmap the pack data so that threads can effectively reload the data when they need it. This also required reworking the error handling paths in a couple places in the code which I tried to make consistent.
2013-03-04indexer: use a hashtable for keeping track of offsetsCarlos Martín Nieto
These offsets are needed for REF_DELTA objects, which encode which object they use as a base, but not where it lies in the packfile, so we need a list. These objects are mostly from older packfiles, before OFS_DELTA was widely spread. The time spent in indexing these packfiles is greatly reduced, though remains above what git is able to do.
2013-01-27Vector improvements and their falloutPhilip Kelley
2013-01-27Fix a mutex leak in pack.cPhilip Kelley
2013-01-14pack: evict all of the pages at onceCarlos Martín Nieto
Somewhat surprisingly, this can increase the speed considerably, as we don't bother trying to decide what to evict, and the most used entries are quickly back into the cache.
2013-01-14pack: evict objects from the cache in groups of eightCarlos Martín Nieto
This drops the cache eviction below libcrypto and zlib in the perf output. The number has been chosen empirically.
2013-01-12pack: fixes to the cacheCarlos Martín Nieto
The offset should be git_off_t, and we should check the return value of the mutex lock function.
2013-01-12indexer: properly free the packfile resourcesCarlos Martín Nieto
The indexer needs to call the packfile's free function so it takes care of freeing the caches. We still need to close the mwf descriptor manually so we can rename the packfile into its final name on Windows.
2013-01-11Revert "pack: packfile_free -> git_packfile_free and use it in the indexers"Carlos Martín Nieto
This reverts commit f289f886cb81bb570bed747053d5ebf8aba6bef7, which makes the tests fail on Windows. Revert until we can figure out a solution.
2013-01-11Fix MSVC compilation warningsnulltoken
2013-01-11pack: packfile_free -> git_packfile_free and use it in the indexersCarlos Martín Nieto
It turns out the indexers have been ignoring the pack's free function and leaking data. Plug that.
2013-01-11pack: limit the amount of memory the base delta cache can useCarlos Martín Nieto
Currently limited to 16MB (like git) and to objects up to 1MB in size.
2013-01-11pack: abstract out the cache into its own functionsCarlos Martín Nieto
2013-01-11pack: refcount entries and add a mutex around cache accessCarlos Martín Nieto
2013-01-11pack: introduce a delta base cacheCarlos Martín Nieto
Many delta bases are re-used. Cache them to avoid inflating the same data repeatedly. This version doesn't limit the amount of entries to store, so it can end up using a considerable amound of memory.
2013-01-09update copyrightsEdward Thomson
2012-12-07Merge pull request #1091 from carlosmn/stream-objectVicent Martí
Indexer speedup with large objects
2012-12-03pack: add git_packfile_resolve_headerDavid Michael Barr
To paraphrase @peff: You can get both size and type from a packed object reasonably cheaply. If you have: * An object that is not a delta; both type and size are available in the packfile header. * An object that is a delta. The packfile type will be OBJ_*_DELTA, and you have to resolve back to the base to find the real type. That means potentially a lot of packfile index lookups, but each one is relatively cheap. For the size, you inflate the first few bytes of the delta, whose header will tell you the resulting size of applying the delta to the base. For simplicity, we just decompress the whole delta for now.
2012-11-30pack: introduce a streaming API for raw objectsCarlos Martín Nieto
This allows us to take objects from the packfile as a stream instead of having to keep it all in memory.
2012-11-28Make git_odb_foreach_cb take const paramRussell Belfer
This makes the first OID param of the ODB callback a const pointer and also propogates that change all the way to the backends.
2012-11-24Set p->mwf.fd to -1 on errorSven Strickroth
If p->mwf.fd is e.g. -2 then it is closed in packfile_free and an exception might be thrown. Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-11-23Remove use of English expletivesMartin Woodward
Remove words such as fuck, crap, shit etc. Remove other potentially offensive words from comments. Tidy up other geopolicital terms in comments.
2012-09-14pack: iterate objects in offset orderDavid Michael Barr
Compute the ordering on demand and persist until the index is freed.
2012-08-06Merge remote-tracking branch 'arrbee/tree-walk-fixes' into developmentVicent Marti
Conflicts: src/notes.c src/transports/git.c src/transports/http.c src/transports/local.c tests-clar/odb/foreach.c
2012-08-04Update iterators for consistency across libraryRussell Belfer
This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules.
2012-07-24portability: Improve x86/amd64 compatibilitynulltoken
2012-07-03odb: add git_odb_foreach()Carlos Martín Nieto
Go through each backend and list every objects that exists in them. This allows fsck-like uses.
2012-06-28mwindow: allow memory-window files to deregisterCarlos Martin Nieto
Once a file is registered, there is no way to deregister it, even after the structure that contains it is no longer needed and has been freed. This may be the source of #624. Allow and use the deregister function to remove our file from the global list.
2012-06-12Actually do the mmap... unsurprisingly, this makes the indexer work on SFSChris Young
On RAM: the .idx and .pack files become links to a .lock and the original download respectively. Assume some feature (such as record locking) supported by SFS but not JXFS or RAM: is required.
2012-06-10Basic mmap/munmap compatiblityChris Young
2012-05-18errors: Rename error codesbreaking-changesVicent Martí
2012-05-18errors: Rename the generic return codesVicent Martí
2012-05-05Fix valgrind issuesRussell Belfer
There are three changes here: - correctly propogate error code from failed object lookups - make zlib inflate use our allocators - add OID to notfound error in ODB lookups
2012-04-24Merge pull request #632 from arrbee/win64-cleanupVicent Martí
Code clean up, including fixing warnings on Windows 64-bit build