OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [nogc.cc] - Blame information for rev 765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 753 jeremybenn
// nogc.cc - Implement null garbage collector.
2
 
3
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2006, 2007
4
   Free Software Foundation
5
 
6
   This file is part of libgcj.
7
 
8
This software is copyrighted work licensed under the terms of the
9
Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
10
details.  */
11
 
12
#include <config.h>
13
 
14
#include <stdio.h>
15
#include <stdlib.h>
16
 
17
#include <gcj/cni.h>
18
#include <jvm.h>
19
 
20
// Total amount of memory allocated.
21
static long total = 0;
22
 
23
void *
24
_Jv_BuildGCDescr(jclass)
25
{
26
  return 0;
27
}
28
 
29
void *
30
_Jv_AllocObj (jsize size, jclass klass)
31
{
32
  total += size;
33
  void *obj = calloc (size, 1);
34
  if (!obj) _Jv_ThrowNoMemory();
35
  *((_Jv_VTable **) obj) = klass->vtable;
36
  return obj;
37
}
38
 
39
void *
40
_Jv_AllocPtrFreeObj (jsize size, jclass klass)
41
{
42
  total += size;
43
  void *obj = calloc (size, 1);
44
  if (!obj) _Jv_ThrowNoMemory();
45
  *((_Jv_VTable **) obj) = klass->vtable;
46
  return obj;
47
}
48
 
49
void *
50
_Jv_AllocArray (jsize size, jclass klass)
51
{
52
  total += size;
53
  void *obj = calloc (size, 1);
54
  if (!obj) _Jv_ThrowNoMemory();
55
  *((_Jv_VTable **) obj) = klass->vtable;
56
  return obj;
57
}
58
 
59
void *
60
_Jv_AllocBytes (jsize size)
61
{
62
  total += size;
63
  void *obj = calloc (size, 1);
64
  if (!obj) _Jv_ThrowNoMemory();
65
  return obj;
66
}
67
 
68
void *
69
_Jv_AllocRawObj (jsize size)
70
{
71
  total += size;
72
  return calloc (size, 1);
73
}
74
 
75
_Jv_ClosureList **
76
_Jv_ClosureListFinalizer ()
77
{
78
  _Jv_ClosureList **clpp;
79
  clpp = (_Jv_ClosureList **)_Jv_AllocBytes (sizeof (*clpp));
80
  return clpp;
81
}
82
 
83
void
84
_Jv_RegisterFinalizer (void *, _Jv_FinalizerFunc *)
85
{
86
  // FIXME: should actually register so that finalizers can be run on
87
  // exit.
88
}
89
 
90
void
91
_Jv_RunFinalizers (void)
92
{
93
}
94
 
95
void
96
_Jv_RunAllFinalizers (void)
97
{
98
  // FIXME: should still run all finalizers.
99
}
100
 
101
void
102
_Jv_GCInitializeFinalizers (void (*) (void))
103
{
104
}
105
 
106
void
107
_Jv_RunGC (void)
108
{
109
}
110
 
111
long
112
_Jv_GCTotalMemory (void)
113
{
114
  return total;
115
}
116
 
117
long
118
_Jv_GCFreeMemory (void)
119
{
120
  return 0;
121
}
122
 
123
void
124
_Jv_GCSetInitialHeapSize (size_t)
125
{
126
}
127
 
128
void
129
_Jv_GCSetMaximumHeapSize (size_t)
130
{
131
}
132
 
133
void
134
_Jv_DisableGC (void)
135
{
136
}
137
 
138
void
139
_Jv_EnableGC (void)
140
{
141
}
142
 
143
void
144
_Jv_InitGC (void)
145
{
146
}
147
 
148
void
149
_Jv_GCRegisterDisappearingLink (jobject *)
150
{
151
}
152
 
153
jboolean
154
_Jv_GCCanReclaimSoftReference (jobject)
155
{
156
  // For now, always reclaim soft references.  FIXME.
157
  return true;
158
}
159
 
160
#ifdef JV_HASH_SYNCHRONIZATION
161
void *
162
_Jv_AllocTraceOne (jsize size /* includes vtable slot */)
163
{
164
  void *obj = calloc(size, 1);
165
  if (!obj) _Jv_ThrowNoMemory();
166
  return result;
167
}
168
 
169
void *
170
_Jv_AllocTraceTwo (jsize size /* includes vtable slot */)
171
{
172
  void *obj = calloc(size, 1);
173
  if (!obj) _Jv_ThrowNoMemory();
174
  return result;
175
}
176
#endif /* JV_HASH_SYNCHRONIZATION */
177
 
178
void
179
_Jv_SuspendThread (_Jv_Thread_t *thread)
180
{
181
}
182
 
183
void
184
_Jv_ResumeThread (_Jv_Thread_t *thread)
185
{
186
}
187
 
188
int
189
_Jv_IsThreadSuspended (_Jv_Thread_t *thread)
190
{
191
  return 0;
192
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.