mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
Merge branch 'dev3' of https://github.com/microsoft/mimalloc into dev3
This commit is contained in:
commit
32788fa93f
3 changed files with 7 additions and 12 deletions
|
@ -161,7 +161,7 @@ static inline mi_page_t* mi_validate_ptr_page(const void* p, const char* msg)
|
|||
void mi_free(void* p) mi_attr_noexcept
|
||||
{
|
||||
mi_page_t* const page = mi_validate_ptr_page(p,"mi_free");
|
||||
if mi_unlikely(page==NULL) return;
|
||||
if mi_unlikely(page==NULL) return; // page will be NULL if p==NULL
|
||||
mi_assert_internal(p!=NULL && page!=NULL);
|
||||
|
||||
const mi_threadid_t xtid = (_mi_prim_thread_id() ^ mi_page_xthread_id(page));
|
||||
|
|
|
@ -31,10 +31,7 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
|
||||
#if defined(__linux__)
|
||||
#include <features.h>
|
||||
#include <linux/prctl.h> // PR_SET_VMA
|
||||
//#if defined(MI_NO_THP)
|
||||
#include <sys/prctl.h> // THP disable
|
||||
//#endif
|
||||
#include <sys/prctl.h> // THP disable, PR_SET_VMA
|
||||
#if defined(__GLIBC__)
|
||||
#include <linux/mman.h> // linux mmap flags
|
||||
#else
|
||||
|
@ -210,7 +207,7 @@ static int unix_madvise(void* addr, size_t size, int advice) {
|
|||
|
||||
static void* unix_mmap_prim(void* addr, size_t size, int protect_flags, int flags, int fd) {
|
||||
void* p = mmap(addr, size, protect_flags, flags, fd, 0 /* offset */);
|
||||
#if (defined(__linux__) && defined(PR_SET_VMA))
|
||||
#if defined(__linux__) && defined(PR_SET_VMA)
|
||||
if (p!=MAP_FAILED && p!=NULL) {
|
||||
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, p, size, "mimalloc");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue