2
* Copyright (C) 2009 Campanoni Simone
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
#include <internal_calls_gc.h>
23
#include <internal_calls_utilities.h>
24
#include <system_manager.h>
25
#include <general_tools.h>
29
void System_GC_KeepAlive (void *object) {
32
/* Fetch the system */
33
system = getSystem(NULL);
34
assert(system != NULL);
36
METHOD_BEGIN(system, "System.GC.KeepAlive");
40
METHOD_END(system, "System.GC.KeepAlive");
43
void System_GC_WaitForPendingFinalizers (void){
46
/* Fetch the system */
47
system = getSystem(NULL);
48
assert(system != NULL);
49
METHOD_BEGIN(system, "System.GC.WaitForPendingFinalizers");
52
METHOD_END(system, "System.GC.WaitForPendingFinalizers");
56
void System_GC_SuppressFinalize (void *object){
59
/* Fetch the system */
60
system = getSystem(NULL);
61
assert(system != NULL);
62
METHOD_BEGIN(system, "System.GC.SuppressFinalize");
64
(system->garbage_collectors).gc.setFinalizedFlag(object);
67
METHOD_END(system, "System.GC.SuppressFinalize");
71
void System_GC_Collect (void){
74
/* Fetch the system */
75
system = getSystem(NULL);
76
assert(system != NULL);
79
METHOD_BEGIN(system, "System.GC.Collect");
82
if (!(system->IRVM).behavior.noExplicitGarbageCollection){
83
(system->garbage_collectors).gc.collect();
87
METHOD_END(system, "System.GC.Collect");
91
/* Get maximum generation number */
92
JITINT32 System_GC_get_MaxGeneration(void) {
94
JITINT32 maximumGeneration;
96
system = getSystem(NULL);
98
METHOD_BEGIN(system, "System.GC.get_MaxGeneration");
100
maximumGeneration = 0;
102
METHOD_END(system, "System.GC.get_MaxGeneration");
104
return maximumGeneration;
107
/* Collect given generation */
108
void System_GC_InternalCollect(JITINT32 generation) {
111
system = getSystem(NULL);
113
METHOD_BEGIN(system, "System.GC.InternalCollect");
117
METHOD_END(system, "System.GC.InternalCollect");