This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Go Garbage Collection Roots
- From: Matt Davis <mattdavis9 at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 30 Sep 2011 12:50:38 +1000
- Subject: Go Garbage Collection Roots
As some of you might know, I have been researching and working on a region-based
memory management plugin for GCC. My target is specifically the Go language.
With that said, I have been making a fair amount of progress. More recently, I
have been benchmarking my work, and it came to my attention that I need to
handle types defined in an external object files. For instance, when a new List
object is created, the external package for List, calls "new" and returns us a
nice sparkly new List object. The runtime of Go implements "new" as "__go_new,"
which calls the runtime's special allocator to produce an object that is garbage
collected. This is causing some snags in my system. Mainly, I want to use my
own allocator, since there is only a special case when I want to use garbage
collection in my region system. Is there a way/interface to register data as a
root in the garbage collector, so that its not in conflict with my allocation?
The other option would be to try to override "__go_new" with my own
implementation, but keeping the same symbol name so that the linker does the
dirty work.
-Matt