mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

fix committed stat

Open maxbachmann opened this issue 1 year ago • 5 comments

_mi_os_free reduces the stat by the full size without taking uncommitted sections into account. For this reason we have to add the uncommitted sections to the stat before calling it.

maxbachmann avatar Aug 28 '24 19:08 maxbachmann

This should fix https://github.com/microsoft/mimalloc/issues/929

maxbachmann avatar Aug 28 '24 19:08 maxbachmann

As an alternative fix we could call _mi_os_free_ex and decrease the stat here.

maxbachmann avatar Aug 28 '24 19:08 maxbachmann

Ha, interesting -- looks like I decreased the commit while it should have been increased since _mi_os_free decreases by the full amount. Let me think a bit more on this but I think you are right.

daanx avatar Aug 29 '24 19:08 daanx

Hello! Is there a reason why this PR can't be merged? We also want to use mi_process_info, but the reported commit size is incorrect.

gozetor avatar Oct 04 '24 21:10 gozetor

Ah, yes it is already in the latest dev/dev-slice but was added manually. I'll close this PR. There will be a fresh release v2.1.8 soon I hope.

daanx avatar Oct 04 '24 22:10 daanx