You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replaces the hardcoded 2MB huge page size with dynamic detection by
parsing /proc/meminfo. This fixes no-mmap allocation failures on
architectures with different default huge page sizes (like ARM64
which often uses 512MB) or x86 systems configured for 1GB pages.
- Safely parses /proc/meminfo without allocating memory.
- Uses raw syscalls and manual byte-by-byte matching to maintain
strict compatibility with CONFIG_NOLIBC builds (avoiding strstr).
- Drops the MAP_HUGE_2MB mmap flag to allow the kernel to correctly
apply the system's default huge page size.
- Falls back safely to 2MB if /proc/meminfo is unreadable.
Signed-off-by: Prateek <kprateek283@gmail.com>
0 commit comments