mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-01-14 08:37:59 +08:00
fix region suitable bug
This commit is contained in:
parent
6ccfb5a93e
commit
7b72a4cd50
@ -281,8 +281,8 @@ static bool mi_region_is_suitable(int numa_node, size_t idx, bool commit, bool a
|
||||
uintptr_t m = mi_atomic_read_relaxed(®ions_map[idx]);
|
||||
if (m == MI_BITMAP_FIELD_FULL) return false;
|
||||
if (numa_node >= 0) { // use negative numa node to always succeed
|
||||
int rnode = ((int)mi_atomic_read_relaxed(®ions->numa_node)) - 1;
|
||||
if (rnode != numa_node) return false;
|
||||
int rnode = ((int)mi_atomic_read_relaxed(®ions[idx].numa_node)) - 1;
|
||||
if (rnode >= 0 && rnode != numa_node) return false;
|
||||
}
|
||||
if (commit && allow_large) return true; // always ok
|
||||
|
||||
@ -290,7 +290,7 @@ static bool mi_region_is_suitable(int numa_node, size_t idx, bool commit, bool a
|
||||
// this is not guaranteed due to multiple threads allocating at the same time but
|
||||
// that's ok. In secure mode, large is never allowed for any thread, so that works out;
|
||||
// otherwise we might just not be able to reset/decommit individual pages sometimes.
|
||||
mi_region_info_t info = mi_atomic_read_relaxed(®ions->info);
|
||||
mi_region_info_t info = mi_atomic_read_relaxed(®ions[idx].info);
|
||||
bool is_large;
|
||||
bool is_committed;
|
||||
void* start = mi_region_info_read(info, &is_large, &is_committed);
|
||||
|
@ -18,7 +18,7 @@ terms of the MIT license.
|
||||
|
||||
// argument defaults
|
||||
static int THREADS = 32; // more repeatable if THREADS <= #processors
|
||||
static int N = 20; // scaling factor
|
||||
static int N = 40; // scaling factor
|
||||
|
||||
// static int THREADS = 8; // more repeatable if THREADS <= #processors
|
||||
// static int N = 100; // scaling factor
|
||||
|
Loading…
x
Reference in New Issue
Block a user