Re: how to find gc roots in stack machine?

anton@mips.complang.tuwien.ac.at (Anton Ertl)
Mon, 01 Jul 2013 15:54:01 GMT

          From comp.compilers

Related articles
how to find gc roots in stack machine? n.oje.bar@gmail.com (2013-07-01)
Re: how to find gc roots in stack machine? nmh@t3x.org (Nils M Holm) (2013-07-01)
Re: how to find gc roots in stack machine? anton@mips.complang.tuwien.ac.at (2013-07-01)
Re: how to find gc roots in stack machine? gneuner2@comcast.net (George Neuner) (2013-07-03)
Re: how to find gc roots in stack machine? gneuner2@comcast.net (George Neuner) (2013-07-04)
| List of all articles for this month |
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.compilers
Date: Mon, 01 Jul 2013 15:54:01 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
References: 13-07-002
Keywords: GC
Posted-Date: 03 Jul 2013 22:40:47 EDT

n.oje.bar@gmail.com writes:
>I am writing a simple compiler for a simple stack machine. Now I want
>to add a garbage collector. To do this I need a way to be able to find
>all roots in the stack at any given time (or at least at some special
>points in time).


Since you want it simple, my recommendation is one of:


A) Use a conservative GC (e.g., Boehm's).


B) Use a separate stack for pointers. Then you know that everything
on that stack is a root (or null), and everything on the other stack
is not. You still have complexity to identify roots in memory; so my
overall recommendation is A.


- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.