mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 23:39:31 +03:00
Merge branch 'dev' into dev2
This commit is contained in:
commit
2697d55fa5
1 changed files with 9 additions and 0 deletions
|
@ -62,6 +62,13 @@ terms of the MIT license. A copy of the license can be found in the file
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MADV_DONTNEED) && defined(POSIX_MADV_DONTNEED) // QNX
|
||||||
|
#define MADV_DONTNEED POSIX_MADV_DONTNEED
|
||||||
|
#endif
|
||||||
|
#if !defined(MADV_FREE) && defined(POSIX_MADV_FREE) // QNX
|
||||||
|
#define MADV_FREE POSIX_MADV_FREE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Use syscalls for some primitives to allow for libraries that override open/read/close etc.
|
// Use syscalls for some primitives to allow for libraries that override open/read/close etc.
|
||||||
|
@ -190,6 +197,8 @@ int _mi_prim_free(void* addr, size_t size ) {
|
||||||
static int unix_madvise(void* addr, size_t size, int advice) {
|
static int unix_madvise(void* addr, size_t size, int advice) {
|
||||||
#if defined(__sun)
|
#if defined(__sun)
|
||||||
int res = madvise((caddr_t)addr, size, advice); // Solaris needs cast (issue #520)
|
int res = madvise((caddr_t)addr, size, advice); // Solaris needs cast (issue #520)
|
||||||
|
#elif defined(__QNX__)
|
||||||
|
int res = posix_madvise(addr, size, advice);
|
||||||
#else
|
#else
|
||||||
int res = madvise(addr, size, advice);
|
int res = madvise(addr, size, advice);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue