You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We only support the linux-gnu target, which is the computer I use everyday. There are a few places that require platform specific stuff that may need to be adapted:
The physical memory getter, see GC_getMemoryLimit in include/memory.h; GC uses this for the default maximum allocatable memory limit;
Pointers to the DATA and BSS sections, which are special fixed-size stacks where (un)initialized constants are allocated; see GC_Collector_init in src/collector.c where I use symbols injected by the linker __data_start, __bss_start and _end; I assume those symbols exist for most ELF executables, but maybe not. Mach-O and PE probably use something entirely different.
The stack bottom detector, only used to detect the beginning of the main thread stack, to properly initialize the stack for the main fiber; see GC.stack_bottom in src/immix.cr;
I currently use a private glibc symbol (__libc_stack_end);
In linux we can read the 28th value from /proc/self/stat as per proc(5) (warning: don't use File because it's a class and relies on GC.malloc).
Other platforms may need to setup a temporary segfault handler, iterate the stack back and wait for a segfault to determine the stack bottom (BDW does that).
Note: the issue is about supporting other POSIX systems, supporting Windows will require to use a File Mapping with INVALID_HANDLE_VALUE instead of an anonymous mmap.
The text was updated successfully, but these errors were encountered:
We only support the linux-gnu target, which is the computer I use everyday. There are a few places that require platform specific stuff that may need to be adapted:
The physical memory getter, see
GC_getMemoryLimit
in include/memory.h; GC uses this for the default maximum allocatable memory limit;Pointers to the DATA and BSS sections, which are special fixed-size stacks where (un)initialized constants are allocated; see
GC_Collector_init
in src/collector.c where I use symbols injected by the linker__data_start
,__bss_start
and_end
; I assume those symbols exist for most ELF executables, but maybe not. Mach-O and PE probably use something entirely different.The stack bottom detector, only used to detect the beginning of the main thread stack, to properly initialize the stack for the main fiber; see
GC.stack_bottom
in src/immix.cr;__libc_stack_end
);/proc/self/stat
as per proc(5) (warning: don't useFile
because it's a class and relies onGC.malloc
).Note: the issue is about supporting other POSIX systems, supporting Windows will require to use a
File Mapping
withINVALID_HANDLE_VALUE
instead of an anonymousmmap
.The text was updated successfully, but these errors were encountered: