1 /* src/mm/cacao-gc/rootset.h - GC header for root set management
3 Copyright (C) 2006, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 typedef struct rootset_t rootset_t;
34 #include "threads/thread.hpp"
36 #include "vm/method.h"
38 #include "vm/jit/replace.hpp"
41 /* Structures *****************************************************************/
43 #define ROOTSET_DUMMY_THREAD ((threadobject *) (ptrint) -1)
45 #define ROOTSET_INITIAL_CAPACITY 16
47 /* rootset is passed as array of pointers, which point to the location of
50 typedef struct rootset_entry_t {
51 java_object_t **ref; /* a pointer to the actual reference */
52 bool marks; /* indicates if a reference marks */
60 rootset_t *next; /* link to the next chain element */
61 threadobject *thread; /* thread this rootset belongs to */
62 s4 capacity; /* the current capacity of this rs */
63 s4 refcount; /* number of references */
64 rootset_entry_t refs[ROOTSET_INITIAL_CAPACITY]; /* list of references */
68 /* Prototypes *****************************************************************/
71 rootset_t *rootset_create(void);
72 void rootset_from_globals(rootset_t *rs);
73 void rootset_from_thread(threadobject *thread, rootset_t *rs);
75 rootset_t *rootset_readout();
76 void rootset_writeback(rootset_t *rs);
79 void rootset_print(rootset_t *rs);
83 #endif /* _ROOTSET_H */
86 * These are local overrides for various environment variables in Emacs.
87 * Please do not remove this and leave it at the end of the file, where
88 * Emacs will automagically detect them.
89 * ---------------------------------------------------------------------
96 * vim:noexpandtab:sw=4:ts=4: