mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-02 01:57:59 +03:00
Restore errno save/restore in pages_purge_process_madvise_impl
TODO comment focused on free only, but this path is reachable via other calls and it is safer to leave errno preservation here.
This commit is contained in:
parent
9ae0c1b6d3
commit
86f058287f
1 changed files with 2 additions and 0 deletions
|
|
@ -662,6 +662,7 @@ pages_purge_process_madvise_impl(
|
|||
return true;
|
||||
}
|
||||
|
||||
int saved_errno = get_errno();
|
||||
size_t purged_bytes = (size_t)syscall(JE_SYS_PROCESS_MADVISE_NR,
|
||||
PIDFD_SELF, (struct iovec *)vec, vec_len, MADV_DONTNEED, 0);
|
||||
if (purged_bytes == (size_t)-1) {
|
||||
|
|
@ -671,6 +672,7 @@ pages_purge_process_madvise_impl(
|
|||
atomic_store_b(
|
||||
&process_madvise_gate, false, ATOMIC_RELAXED);
|
||||
}
|
||||
set_errno(saved_errno);
|
||||
}
|
||||
|
||||
return purged_bytes != total_bytes;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue