[LLVMdev] 2.2 garbage collector questions

thomas weidner 3.14159 at gmx.net
Mon Feb 4 09:20:31 PST 2008


Hello,

i want to implement a common lisp subset using llvm for fun. This 
requires the use of a garbage collector. I read the docs, but many 
things are still unclear to me.
1. how are collectors supposed to find all living objects? there is 
llvm.gcroot for marking objects on the stack,but how do collectors crawl 
heap objects? I did not see a way to provide custom mark functions. Are 
collectors supposed to rely on the type informations provided by llvm?
2. what about gcreading and gcwriting objects of a different type than i8*?
3. No Intrinsic for allocating gc memory?
4. When passing a gc managed pointer to a c function,how should that 
function access the pointer? directly? there seem to be functions for 
that in the runtime/ source directory,but it also seems to be meant for 
the llvm c frontend? (and not for use in an extra c library)
5. some collectors update pointers upon read/write access, can the llvm 
gc api provide this?

sorry for so many questions (and sorry if some of them may be stupid).
thanks in advance for help.

	thomas




More information about the llvm-dev mailing list