summaryrefslogtreecommitdiff
path: root/src/mwindow.c
Commit message (Collapse)AuthorAgeFilesLines
* Global options setterVicent Marti2013-01-231-16/+7
|
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* git_mwindow_file_deregister() shouldn't return errorsScott J. Goldman2013-01-051-9/+4
| | | | | | | | | | | As a function that appears to only be called on error paths, I don't think it makes sense for it to return an error, or clobber the global giterr. Note that no existing callsites actually check the return code. In my own application, there are errors where the real error ends up being hidden, as git_mwindow_file_deregister() clobbers the global giterr. I'm not sure this error is even relevant?
* Always check the result of git_mutex_lockJustin Spahr-Summers2012-12-091-5/+24
|
* Make the memory-window conrol structures globalCarlos Martín Nieto2012-08-201-11/+37
| | | | | | | | | | | | | Up to now, the idea was that the user would do all the operations for one repository in the same thread. Thus we could have the memory-mapped window information thread-local and avoid any locking. This is not practical in a few environments, such as Apple's GCD which allocates threads arbitrarily or the .NET CLR, where the OS-level thread can change at any moment. Make the control structure global and protect it with a mutex so we don't depend on the thread currently executing the code.
* mwindow: allow memory-window files to deregisterCarlos Martin Nieto2012-06-281-0/+17
| | | | | | | | | 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.
* Actually do the mmap... unsurprisingly, this makes the indexer work on SFSChris Young2012-06-121-0/+1
| | | | | 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.
* Remove left-over debugging outputCarlos Martín Nieto2012-05-231-2/+0
|
* Update test suiteVicent Martí2012-05-021-2/+1
|
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-021-27/+27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
| * indexer: start writing the stream indexerCarlos Martín Nieto2012-04-131-1/+5
| | | | | | | | | | | | This will allow us to index a packfile as soon as we receive it from the network as well as storing it with its final name so we don't need to pass temporary file names around.
| * Convert attr, ignore, mwindow, status to new errorsRussell Belfer2012-03-161-15/+16
| | | | | | | | | | Also cleaned up some previously converted code that still had little things to polish.
| * Continue error conversionRussell Belfer2012-03-141-1/+1
| | | | | | | | | | | | | | 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.
| * Migrate ODB files to new error handlingRussell Belfer2012-03-121-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This migrates odb.c, odb_loose.c, odb_pack.c and pack.c to the new style of error handling. Also got the unix and win32 versions of map.c. There are some minor changes to other files but no others were completely converted. This also contains an update to filebuf so that a zeroed out filebuf will not think that the fd (== 0) is actually open (and inadvertently call close() on fd 0 if cleaned up). Lastly, this was built and tested on win32 and contains a bunch of fixes for the win32 build which was pretty broken.
* | mwindow: make sure the whole range is contained inside the same windowCarlos Martín Nieto2012-04-041-3/+4
|/ | | | | | | | | Looking through the open windows to check whether we can re-use an open window should take into account whether both `offset` and `offset + extra` are contained within the same window. Failure to do so can lead to invalid memory accesses. This closes #614. While we're in the area remove an outdated assert.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* threads: Fix the shared global state with TLSVicent Marti2011-11-161-44/+52
| | | | | | | See `global.c` for a description of what we're doing. When libgit2 is built with GIT_THREADS support, the threading system must be explicitly initialized with `git_threads_init()`.
* global: Properly use `git__` memory wrappersVicent Marti2011-10-281-3/+3
| | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* mwindow: close LRU window properlyCarlos Martín Nieto2011-10-151-5/+12
| | | | | | | | | | | Remove a wrong call to git_mwindow_close which caused a segfault if it ever did run. In that same piece of code, if the LRU was from the first wiindow in the list in a different file, we didn't update that list, so the first element had been freed. Fix these two issues. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Merge pull request #384 from kiryl/warningsVicent Martí2011-09-181-1/+1
|\ | | | | Add more -W flags to CFLAGS
| * CMakefile: add -Wmissing-prototypes and fix warningsKirill A. Shutemov2011-08-301-1/+1
| | | | | | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* | Tabify everythingVicent Marti2011-09-191-4/+4
| | | | | | | | | | | | There were quite a few places were spaces were being used instead of tabs. Try to catch them all. This should hopefully not break anything. Except for `git blame`. Oh well.
* | 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.
* | Fix an integral overflow on 64-bitSebastian Schuberth2011-09-081-1/+1
|/
* mwindow.c: fix -Wmissing-field-initializersschu2011-08-091-1/+6
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Fix compilation in WindowsVicent Marti2011-08-081-16/+15
|
* Make packfile_unpack_header more genericCarlos Martín Nieto2011-08-021-3/+3
| | | | | | On the way, store the fd and the size in the mwindow file. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Factor out the mmap window codeCarlos Martín Nieto2011-08-021-0/+271
This code is useful for more things than just the packfile handling code. Factor it out so it can be reused. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>