Mercurial > minori
diff dep/animia/src/fd/xnu.cc @ 230:2f5a9247e501
torrents: implement download button
erg
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sat, 13 Jan 2024 09:42:02 -0500 |
parents | bc1ae1810855 |
children |
line wrap: on
line diff
--- a/dep/animia/src/fd/xnu.cc Wed Jan 10 21:23:57 2024 -0500 +++ b/dep/animia/src/fd/xnu.cc Sat Jan 13 09:42:02 2024 -0500 @@ -17,12 +17,12 @@ namespace animia::internal::xnu { bool EnumerateOpenProcesses(process_proc_t process_proc) { - size_t pids_size = 512; + size_t pids_size = 256; std::unique_ptr<pid_t[]> pids; int returned_size = 0; do { - pids.reset(new pid_t[pids_size]); + pids.reset(new pid_t[pids_size *= 2]); returned_size = proc_listpids(PROC_ALL_PIDS, 0, pids.get(), pids_size * sizeof(pid_t)); if (returned_size == -1) return false;