Merge pull request #481 from devnexen/haiku_settings

Haiku set explicitly to performance.
This commit is contained in:
van Hauser 2020-07-31 18:42:06 +02:00 committed by GitHub
commit ca17ec3fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -82,6 +82,11 @@
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */ #endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */
#if defined(__HAIKU__)
#include <kernel/OS.h>
#include <kernel/scheduler.h>
#endif
/* For systems that have sched_setaffinity; right now just Linux, but one /* For systems that have sched_setaffinity; right now just Linux, but one
can hope... */ can hope... */

View File

@ -1057,6 +1057,11 @@ int main(int argc, char **argv_orig, char **envp) {
bind_to_free_cpu(afl); bind_to_free_cpu(afl);
#endif /* HAVE_AFFINITY */ #endif /* HAVE_AFFINITY */
#ifdef __HAIKU__
/* Prioritizes performance over power saving */
set_scheduler_mode(SCHEDULER_MODE_LOW_LATENCY);
#endif
afl->fsrv.trace_bits = afl->fsrv.trace_bits =
afl_shm_init(&afl->shm, afl->fsrv.map_size, afl->non_instrumented_mode); afl_shm_init(&afl->shm, afl->fsrv.map_size, afl->non_instrumented_mode);