mirror of
https://github.com/microsoft/mimalloc.git
synced 2024-12-28 22:05:40 +08:00
don't decommit/reset parts of a region when using large os pages
This commit is contained in:
parent
beef7a8c70
commit
d706109b35
12
src/memory.c
12
src/memory.c
@ -312,11 +312,13 @@ void _mi_mem_free(void* p, size_t size, size_t id, mi_stats_t* stats) {
|
||||
// TODO: implement delayed decommit/reset as these calls are too expensive
|
||||
// if the memory is reused soon.
|
||||
// reset: 10x slowdown on malloc-large, decommit: 17x slowdown on malloc-large
|
||||
if (mi_option_is_enabled(mi_option_eager_region_commit)) {
|
||||
_mi_os_reset(p, size, stats); // 10x slowdown on malloc-large
|
||||
}
|
||||
else {
|
||||
_mi_os_decommit(p, size, stats); // 17x slowdown on malloc-large
|
||||
if (!mi_option_is_enabled(mi_option_large_os_pages)) {
|
||||
if (mi_option_is_enabled(mi_option_eager_region_commit)) {
|
||||
_mi_os_reset(p, size, stats); // 10x slowdown on malloc-large
|
||||
}
|
||||
else {
|
||||
_mi_os_decommit(p, size, stats); // 17x slowdown on malloc-large
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: should we free empty regions?
|
||||
|
Loading…
x
Reference in New Issue
Block a user