summaryrefslogtreecommitdiff
path: root/src/win32
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-05-13 02:41:48 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-05-17 01:39:43 +0200
commitf7310540ae888454f9ab69200cfcd8df07faf957 (patch)
tree5f44f5b95c7191c1319846a8ef3534f352f8a98d /src/win32
parentadebcb1645f7bd652ff4449ecf41c39ded12d0c7 (diff)
downloadlibgit2-f7310540ae888454f9ab69200cfcd8df07faf957.tar.gz
indexer: use mmap for writing
Some OSs cannot keep their ideas about file content straight when mixing standard IO with file mapping. As we use mmap for reading from the packfile, let's make writing to the pack file use mmap.
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/map.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/win32/map.c b/src/win32/map.c
index 902ea3994..ef83f882e 100644
--- a/src/win32/map.c
+++ b/src/win32/map.c
@@ -23,6 +23,11 @@ static DWORD get_page_size(void)
return page_size;
}
+long git__page_size(void)
+{
+ return (long)get_page_size();
+}
+
int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset)
{
HANDLE fh = (HANDLE)_get_osfhandle(fd);