mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-11 21:18:46 -05:00
mimalloc: avoid excessive memory retention
In commit cfe73e9d (wip: merging from upstream, 2024-12-25), mimalloc introduced a bug where memory is retained excessively. This leads to a problem e.g. when fetching Git for Windows' `main` branch using the i686 variant of Git for Windows because it simply runs out of address space. Fix this as suggested in https://github.com/microsoft/mimalloc/issues/1025#issuecomment-2768863283 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -166,7 +166,7 @@ static void mi_os_prim_free(void* addr, size_t size, size_t commit_size) {
|
||||
void _mi_os_free_ex(void* addr, size_t size, bool still_committed, mi_memid_t memid) {
|
||||
if (mi_memkind_is_os(memid.memkind)) {
|
||||
size_t csize = memid.mem.os.size;
|
||||
if (csize==0) { _mi_os_good_alloc_size(size); }
|
||||
if (csize==0) { csize = _mi_os_good_alloc_size(size); }
|
||||
size_t commit_size = (still_committed ? csize : 0);
|
||||
void* base = addr;
|
||||
// different base? (due to alignment)
|
||||
|
||||
Reference in New Issue
Block a user