mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 06:59:32 +03:00
Merge pull request #548 from Biswa96/strict_prototypes
Fix strict function prototype warnings
This commit is contained in:
commit
674ee63fa7
1 changed files with 5 additions and 5 deletions
10
src/os.c
10
src/os.c
|
@ -108,7 +108,7 @@ bool _mi_os_has_overcommit(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// OS (small) page size
|
// OS (small) page size
|
||||||
size_t _mi_os_page_size() {
|
size_t _mi_os_page_size(void) {
|
||||||
return os_page_size;
|
return os_page_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ static PGetCurrentProcessorNumberEx pGetCurrentProcessorNumberEx = NULL;
|
||||||
static PGetNumaProcessorNodeEx pGetNumaProcessorNodeEx = NULL;
|
static PGetNumaProcessorNodeEx pGetNumaProcessorNodeEx = NULL;
|
||||||
static PGetNumaNodeProcessorMaskEx pGetNumaNodeProcessorMaskEx = NULL;
|
static PGetNumaNodeProcessorMaskEx pGetNumaNodeProcessorMaskEx = NULL;
|
||||||
|
|
||||||
static bool mi_win_enable_large_os_pages()
|
static bool mi_win_enable_large_os_pages(void)
|
||||||
{
|
{
|
||||||
if (large_os_page_size > 0) return true;
|
if (large_os_page_size > 0) return true;
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ void _mi_os_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined(__wasi__)
|
#elif defined(__wasi__)
|
||||||
void _mi_os_init() {
|
void _mi_os_init(void) {
|
||||||
os_overcommit = false;
|
os_overcommit = false;
|
||||||
os_page_size = 64*MI_KiB; // WebAssembly has a fixed page size: 64KiB
|
os_page_size = 64*MI_KiB; // WebAssembly has a fixed page size: 64KiB
|
||||||
os_alloc_granularity = 16;
|
os_alloc_granularity = 16;
|
||||||
|
@ -262,7 +262,7 @@ static void os_detect_overcommit(void) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void _mi_os_init() {
|
void _mi_os_init(void) {
|
||||||
// get the page size
|
// get the page size
|
||||||
long result = sysconf(_SC_PAGESIZE);
|
long result = sysconf(_SC_PAGESIZE);
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
|
@ -1295,7 +1295,7 @@ void _mi_os_free_huge_pages(void* p, size_t size, mi_stats_t* stats) {
|
||||||
Support NUMA aware allocation
|
Support NUMA aware allocation
|
||||||
-----------------------------------------------------------------------------*/
|
-----------------------------------------------------------------------------*/
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static size_t mi_os_numa_nodex() {
|
static size_t mi_os_numa_nodex(void) {
|
||||||
USHORT numa_node = 0;
|
USHORT numa_node = 0;
|
||||||
if (pGetCurrentProcessorNumberEx != NULL && pGetNumaProcessorNodeEx != NULL) {
|
if (pGetCurrentProcessorNumberEx != NULL && pGetNumaProcessorNodeEx != NULL) {
|
||||||
// Extended API is supported
|
// Extended API is supported
|
||||||
|
|
Loading…
Add table
Reference in a new issue