Linas Vepstas <[email protected]>: > So if you used GC_malloc_atomic() in your code, then gc will NOT scan > that region for pointers. guile-2.2 does this correctly for strings (I > checked) because strings will never contain pointers. I have not > checked other uses.
The question about mmap(2) is addressed more directly by the README under <URL: https://github.com/ivmai/bdwgc>: Any objects not intended to be collected must be pointed to either from other such accessible objects, or from the registers, stack, data, or statically allocated bss segments. [...] WARNING: pointers inside memory allocated by the standard malloc are not seen by the garbage collector. Thus objects pointed to only from such a region may be prematurely deallocated. It is thus suggested that the standard malloc be used only for memory regions, such as I/O buffers, that are guaranteed not to contain pointers to garbage collectible memory. [...] WARNING: the collector does not guarantee to scan thread-local storage (e.g. of the kind accessed with pthread_getspecific). The collector does scan thread stacks Now, the question is, can you make your multigigabyte allocation go into these excluded memory segments? Are you still hit by the pathological GC behavior you reported? Marko
