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.h"
36 #include "vm/jit/replace.h"
37 #include "vmcore/method.h"
40 /* Structures *****************************************************************/
42 #define ROOTSET_DUMMY_THREAD ((threadobject *) (ptrint) -1)
44 #define ROOTSET_INITIAL_CAPACITY 16
46 /* rootset is passed as array of pointers, which point to the location of
49 typedef struct rootset_entry_t {
50 java_object_t **ref; /* a pointer to the actual reference */
51 bool marks; /* indicates if a reference marks */
59 rootset_t *next; /* link to the next chain element */
60 threadobject *thread; /* thread this rootset belongs to */
61 s4 capacity; /* the current capacity of this rs */
62 s4 refcount; /* number of references */
63 rootset_entry_t refs[ROOTSET_INITIAL_CAPACITY]; /* list of references */
67 /* Prototypes *****************************************************************/
70 rootset_t *rootset_create(void);
71 void rootset_from_globals(rootset_t *rs);
72 void rootset_from_thread(threadobject *thread, rootset_t *rs);
74 rootset_t *rootset_readout();
75 void rootset_writeback(rootset_t *rs);
78 void rootset_print(rootset_t *rs);
82 #endif /* _ROOTSET_H */
85 * These are local overrides for various environment variables in Emacs.
86 * Please do not remove this and leave it at the end of the file, where
87 * Emacs will automagically detect them.
88 * ---------------------------------------------------------------------
95 * vim:noexpandtab:sw=4:ts=4: