summaryrefslogtreecommitdiff
path: root/sysdep/unix/alloc.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-09 09:13:20 +0100
committerMaria Matejka <mq@ucw.cz>2022-03-09 09:13:20 +0100
commit1c7df2c24029d6721745b99fd4137935db03e257 (patch)
treeb0b5e1ab704e1744d90c195a30ab51c74133ffc6 /sysdep/unix/alloc.c
parent1740ff57e8ea05d7d9f15d1a6830ce42add3e4bd (diff)
Revert "Multipage allocation"
This reverts commit 6cd37713781a3092f8166b2178fae35cbfec1e28.
Diffstat (limited to 'sysdep/unix/alloc.c')
-rw-r--r--sysdep/unix/alloc.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/sysdep/unix/alloc.c b/sysdep/unix/alloc.c
index 4c9d5eb5..f6296afe 100644
--- a/sysdep/unix/alloc.c
+++ b/sysdep/unix/alloc.c
@@ -17,7 +17,6 @@
#endif
long page_size = 0;
-_Bool alloc_multipage = 0;
#ifdef HAVE_MMAP
static _Bool use_fake = 0;
@@ -46,31 +45,9 @@ alloc_sys_page(void)
#ifdef HAVE_MMAP
if (!use_fake)
{
- if (alloc_multipage)
- {
- void *big = mmap(NULL, page_size * 2, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (big == MAP_FAILED)
- bug("mmap(%lu) failed: %m", page_size);
-
- uintptr_t offset = ((uintptr_t) big) % page_size;
- if (offset)
- {
- void *ret = big + page_size - offset;
- munmap(big, page_size - offset);
- munmap(ret + page_size, offset);
- return ret;
- }
- else
- {
- munmap(big + page_size, page_size);
- return big;
- }
- }
-
void *ret = mmap(NULL, page_size, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (ret == MAP_FAILED)
bug("mmap(%lu) failed: %m", page_size);
-
return ret;
}
else