notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add a thp-based huge page alloc fallback
[pcsx_rearmed.git]
/
libpcsxcore
/
lightrec
/
mem.c
diff --git
a/libpcsxcore/lightrec/mem.c
b/libpcsxcore/lightrec/mem.c
index
efabdb0
..
b5caa78
100644
(file)
--- a/
libpcsxcore/lightrec/mem.c
+++ b/
libpcsxcore/lightrec/mem.c
@@
-55,8
+55,12
@@
static void * mmap_huge(void *addr, size_t length, int prot, int flags,
if (map == MAP_FAILED) {
map = mmap(addr, length, prot, flags, fd, offset);
if (map == MAP_FAILED) {
map = mmap(addr, length, prot, flags, fd, offset);
- if (map != MAP_FAILED)
+ if (map != MAP_FAILED)
{
printf("Regular mmap to address 0x%lx succeeded\n", (uintptr_t) addr);
printf("Regular mmap to address 0x%lx succeeded\n", (uintptr_t) addr);
+#ifdef MADV_HUGEPAGE
+ madvise(map, length, MADV_HUGEPAGE);
+#endif
+ }
}
return map;
}
return map;