Fixed darwin build (#178)
* RSIZE_MAX is already defined by system on darwin * MADV_HUGEPAGE is not available on darwin * Fixed linker error 'Undefined symbol _get_ext_lib_export_apis' on darwin when building iwasm dylib
This commit is contained in:
@ -5,6 +5,10 @@
|
||||
|
||||
#include "bh_platform.h"
|
||||
|
||||
#ifdef RSIZE_MAX
|
||||
#undef RSIZE_MAX
|
||||
#endif
|
||||
|
||||
#define RSIZE_MAX 0x7FFFFFFF
|
||||
|
||||
int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n)
|
||||
|
||||
@ -137,12 +137,14 @@ bh_mmap(void *hint, uint32 size, int prot, int flags)
|
||||
request_size -= size;
|
||||
}
|
||||
|
||||
#ifndef __APPLE__
|
||||
if (size >= 2 * 1024 * 1024) {
|
||||
/* Try to use huge page to improve performance */
|
||||
if (!madvise(addr, size, MADV_HUGEPAGE))
|
||||
/* make huge page become effective */
|
||||
memset(addr, 0, size);
|
||||
}
|
||||
#endif
|
||||
|
||||
return addr_aligned;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user