Open davide-digennaro-nozomi opened 10 months ago
Your proposal makes sense, would be nice to come with tests before and after the change, what do you think ?
Anyhow, snmalloc already uses MADV_FREE for FreeBSD.
_mi_prim_commit
? (I don't think so, but...)madvise
i.e. force a decommit from c++ code? I'm not sure a plain delete
is sufficient.thanks
Hello, sorry to revive an old thread, but the issue is still open. I noticed that the code in v2.17 is slightly different.
1) I think I only need to change the constant in _mi_prim_decommit
. can you confirm?
2) do I also need to change the value returned in *needs_recommit
?
thanks Davide
Apparently mimalloc uses MADV_DONTNEED on unix-like platforms in
prim.c
:however the semantics of MADV_DONTNEED is not identical on every platform. According to man pages:
So it would make sense to prefer MADV_FREE (at least) in Freeebsd. Likely, the same may be true also in MacOS, but we didn't test.
What we propose is something like: