diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 13:54:10 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 13:54:10 +0000 |
commit | 63faed5b8e4f2755f127fcb8aa440480c0649327 (patch) | |
tree | 19c69a04768629f2d440944b71cbe90adae0b615 /docs/GarbageCollection.html | |
parent | d4c8b5d2e851b0e8a063c6bf8543a4823a26c15a (diff) |
Notes
Diffstat (limited to 'docs/GarbageCollection.html')
-rw-r--r-- | docs/GarbageCollection.html | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/GarbageCollection.html b/docs/GarbageCollection.html index 10bc6632c59f5..9463eaa64f255 100644 --- a/docs/GarbageCollection.html +++ b/docs/GarbageCollection.html @@ -429,7 +429,8 @@ programs that use different garbage collection algorithms (or none at all).</p> <p>The <tt>llvm.gcroot</tt> intrinsic is used to inform LLVM that a stack variable references an object on the heap and is to be tracked for garbage collection. The exact impact on generated code is specified by a <a -href="#plugin">compiler plugin</a>.</p> +href="#plugin">compiler plugin</a>. All calls to <tt>llvm.gcroot</tt> <b>must</b> reside + inside the first basic block.</p> <p>A compiler which uses mem2reg to raise imperative code using <tt>alloca</tt> into SSA form need only add a call to <tt>@llvm.gcroot</tt> for those variables @@ -437,7 +438,9 @@ which a pointers into the GC heap.</p> <p>It is also important to mark intermediate values with <tt>llvm.gcroot</tt>. For example, consider <tt>h(f(), g())</tt>. Beware leaking the result of -<tt>f()</tt> in the case that <tt>g()</tt> triggers a collection.</p> +<tt>f()</tt> in the case that <tt>g()</tt> triggers a collection. Note, that +stack variables must be initialized and marked with <tt>llvm.gcroot</tt> in +function's prologue.</p> <p>The first argument <b>must</b> be a value referring to an alloca instruction or a bitcast of an alloca. The second contains a pointer to metadata that @@ -1379,7 +1382,7 @@ Fergus Henderson. International Symposium on Memory Management 2002.</p> <a href="mailto:sabre@nondot.org">Chris Lattner</a><br> <a href="http://llvm.org/">LLVM Compiler Infrastructure</a><br> - Last modified: $Date: 2011-08-12 08:17:17 +0200 (Fri, 12 Aug 2011) $ + Last modified: $Date: 2012-03-03 05:32:33 +0100 (Sat, 03 Mar 2012) $ </address> </body> |