mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v3.19.3
This commit is contained in:
24
malloc-huge.h
Normal file
24
malloc-huge.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#if !(defined(MALLOC_HUGE__))
|
||||
#define MALLOC_HUGE__
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __unix__
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#if defined(MAP_HUGETLB)
|
||||
|
||||
// Minimum block size 6 MiB to use huge pages
|
||||
#define HUGEPAGE_MIN_ALLOC (6 * 1024 * 1024)
|
||||
|
||||
#endif
|
||||
|
||||
// Attempt to allocate memory backed by 2 MiB pages, returns NULL on failure.
|
||||
void *malloc_hugepages( size_t size );
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user