The virtual machine I'm implementing allocates objects on the heap using Boehm's garbage collector. I currently have an interpreter working for my language, and I'm working on a JIT that will compile some of the functions that would otherwise get interpreted. What I'm wondering is whether or not I need to perform special adjustments for the GC to work properly. My understanding is that the Boehm GC can scan the stack for roots. Functions compiled from LLVM into machine code should just be normal functions on the stack when they are called... And thus, I don't think I need to change anything, Boehm's GC should be able to find roots in those functions when they are on the stack just as well as any C/C++ function. Am I mistaken about this? -- View this message in context: nabble.com/LLVM-JIT-+-Boehm's-GC,-Need-I-Worry--tp22439304p22439304.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Nyx wrote:> The virtual machine I'm implementing allocates objects on the heap using > Boehm's garbage collector. I currently have an interpreter working for my > language, and I'm working on a JIT that will compile some of the functions > that would otherwise get interpreted. > > What I'm wondering is whether or not I need to perform special adjustments > for the GC to work properly. My understanding is that the Boehm GC can scan > the stack for roots. Functions compiled from LLVM into machine code should > just be normal functions on the stack when they are called... And thus, I > don't think I need to change anything, Boehm's GC should be able to find > roots in those functions when they are on the stack just as well as any > C/C++ function. > > Am I mistaken about this? >No mistakes here :) You don't need to do anything with the Boehm GC. VMKit uses it without doing anything. Nicolas