1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-11 16:20:19 +02:00

Rework options interface

Users will want to set options from an environment variable or something
like that.  Particular GC implementations will want to expose an
expanded set of options.  For these reasons we make the options
interface a bit more generalized and include parsing.
This commit is contained in:
Andy Wingo 2023-02-15 10:50:17 +01:00
parent 499ff1fe76
commit 4cb26e0144
14 changed files with 411 additions and 257 deletions

View file

@ -3,6 +3,7 @@
#include <errno.h>
#include <link.h>
#include <pthread.h>
#include <sched.h>
#include <stdio.h>
#include <unistd.h>
@ -102,3 +103,10 @@ void gc_platform_visit_global_conservative_roots(void (*f)(uintptr_t start,
struct visit_data visit_data = { f, heap, data };
dl_iterate_phdr(visit_roots, &visit_data);
}
int gc_platform_processor_count(void) {
cpu_set_t set;
if (sched_getaffinity(0, sizeof (set), &set) != 0)
return 1;
return CPU_COUNT(&set);
}