summaryrefslogtreecommitdiff
path: root/src/unix/map.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2016-03-16 19:05:11 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2016-03-16 21:36:25 +0100
commit87c181970dbe629befa98aafeee75b2641dacf63 (patch)
treeaae18c85980ebbe346a30048e6c0bacfe61a3381 /src/unix/map.c
parent77394a27af283b366fa8bb444d29670131bfa104 (diff)
downloadlibgit2-cmn/pool-limit.tar.gz
Split the page size from the mmap alignmentcmn/pool-limit
While often similar, these are not the same on Windows. We want to use the page size on Windows for the pools, but for mmap we need to use the allocation granularity as the alignment. On the other platforms these values remain the same.
Diffstat (limited to 'src/unix/map.c')
-rw-r--r--src/unix/map.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/unix/map.c b/src/unix/map.c
index 72abb3418..c55ad1aa7 100644
--- a/src/unix/map.c
+++ b/src/unix/map.c
@@ -24,6 +24,11 @@ int git__page_size(size_t *page_size)
return 0;
}
+int git__mmap_alignment(size_t *alignment)
+{
+ return git__page_size(alignment);
+}
+
int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset)
{
int mprot = PROT_READ;