Skip to content

Commit 7ed891a

Browse files
authored
Update mmap-next.patch
Making a bad hack even worse; but maybe more performant.
1 parent d54e282 commit 7ed891a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

overlays/patches/ghc/mmap-next.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ index f1c0db7c92..fa3bb41292 100644
3030
+ // we are going to look for up to pageSize * 1024 * 1024 (4GB) from the
3131
+ // address.
3232
+ size_t pageSize = getPageSize();
33-
+ for(int i = (uintptr_t)addr & (pageSize-1) ? 1 : 0; i < 1024*1024; i++) {
33+
+ static int i = (uintptr_t)addr & (pageSize-1) ? 1 : 0; for(; i < 1024*1024; i++) {
3434
+ void *target = (void*)(((uintptr_t)addr & ~(pageSize-1))+(i*pageSize));
3535
+ void *mem = mmap(target, length, prot, flags, fd, offset);
3636
+ if(mem == NULL) return mem;

0 commit comments

Comments
 (0)