summaryrefslogtreecommitdiff
path: root/src/pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pool.c')
-rw-r--r--src/pool.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/pool.c b/src/pool.c
index 146f118b4..1042f7645 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -1,4 +1,5 @@
#include "pool.h"
+#include "posix.h"
#ifndef GIT_WIN32
#include <unistd.h>
#endif
@@ -305,17 +306,10 @@ uint32_t git_pool__system_page_size(void)
static uint32_t size = 0;
if (!size) {
-#ifdef GIT_WIN32
- SYSTEM_INFO info;
- GetSystemInfo(&info);
- size = (uint32_t)info.dwPageSize;
-#elif defined(__amigaos4__)
- size = (uint32_t)4096; /* 4K as there is no global value we can query */
-#else
- size = (uint32_t)sysconf(_SC_PAGE_SIZE);
-#endif
-
- size -= 2 * sizeof(void *); /* allow space for malloc overhead */
+ size_t page_size;
+ if (git__page_size(&page_size) < 0)
+ page_size = 4096;
+ size = page_size - 2 * sizeof(void *); /* allow space for malloc overhead */
}
return size;