1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-28 05:50:30 +02:00

Use PROT_NONE to reserve memory, then remap within that memory

Should play better with the kernel's overcommit heuristics.
This commit is contained in:
Andy Wingo 2024-11-23 09:13:57 +01:00
parent 922c13a183
commit 6a6f5b09e3
2 changed files with 52 additions and 6 deletions

View file

@ -24,6 +24,21 @@ GC_INTERNAL int gc_platform_processor_count(void);
GC_INTERNAL uint64_t gc_platform_monotonic_nanoseconds(void);
GC_INTERNAL size_t gc_platform_page_size(void);
struct gc_reservation {
uintptr_t base;
size_t size;
};
GC_INTERNAL
struct gc_reservation gc_platform_reserve_memory(size_t size, size_t alignment);
GC_INTERNAL
void*
gc_platform_acquire_memory_from_reservation(struct gc_reservation reservation,
size_t offset, size_t size);
GC_INTERNAL
void gc_platform_release_reservation(struct gc_reservation reservation);
GC_INTERNAL void* gc_platform_acquire_memory(size_t size, size_t alignment);
GC_INTERNAL void gc_platform_release_memory(void *base, size_t size);