Commit Graph

11 Commits

Author SHA1 Message Date
Edward Thomson
359fc2d241 update copyrights 2013-01-08 17:31:27 -06:00
Scott J. Goldman
f9b55bcb5f git_mwindow_file_deregister() shouldn't return errors
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?
2013-01-05 18:27:24 -08:00
Carlos Martín Nieto
8cef828d8d Make the memory-window conrol structures global
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.
2012-08-20 12:02:52 +02:00
Carlos Martin Nieto
1d8943c640 mwindow: allow memory-window files to deregister
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-28 12:10:33 +02:00
Russell Belfer
deafee7bd7 Continue error conversion
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.
2012-03-14 17:36:15 -07:00
schu
5e0de32818 Update Copyright header
Signed-off-by: schu <schu-github@schulog.org>
2012-02-13 17:11:09 +01:00
Vicent Marti
a15c550db8 threads: Fix the shared global state with TLS
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()`.
2011-11-16 14:09:44 +01:00
Vicent Marti
bb742ede3d Cleanup legal data
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.
2011-09-19 01:54:32 +03:00
Vicent Marti
f6867e639a Fix compilation in Windows 2011-08-08 16:56:28 -07:00
Carlos Martín Nieto
7d0cdf82be Make packfile_unpack_header more generic
On the way, store the fd and the size in the mwindow file.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-02 21:42:03 +02:00
Carlos Martín Nieto
7bfdb3d22b Factor out the mmap window code
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>
2011-08-02 20:53:51 +02:00