mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
Add malloc logging tool
STATIC_YOINK("enable_memory_log");
This commit is contained in:
parent
7e9fb0a9f1
commit
cb67223051
25 changed files with 502 additions and 78 deletions
|
@ -163,9 +163,13 @@ static noasan int Munmap(char *p, size_t n) {
|
|||
*/
|
||||
noasan int munmap(void *p, size_t n) {
|
||||
int rc;
|
||||
size_t toto;
|
||||
_spinlock(&_mmi.lock);
|
||||
rc = Munmap(p, n);
|
||||
#if SYSDEBUG
|
||||
toto = __strace > 0 ? GetMemtrackSize(&_mmi) : 0;
|
||||
#endif
|
||||
_spunlock(&_mmi.lock);
|
||||
STRACE("munmap(%.12p, %'zu) → %d% m", p, n, rc);
|
||||
STRACE("munmap(%.12p, %'zu) → %d% m (%'zu bytes total)", p, n, rc, toto);
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue