OSDN Git Service

* java/util/Timer.java: New version from Classpath.
[pf3gnuchains/gcc-fork.git] / libjava / nogc.cc
1 // nogc.cc - Implement null garbage collector.
2
3 /* Copyright (C) 1998, 1999, 2000  Free Software Foundation
4
5    This file is part of libgcj.
6
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
9 details.  */
10
11 #include <config.h>
12
13 #include <stdio.h>
14 #include <stdlib.h>
15
16 #include <gcj/cni.h>
17 #include <jvm.h>
18
19 // Total amount of memory allocated.
20 static long total = 0;
21
22 #ifdef INTERPRETER
23 void *
24 _Jv_BuildGCDescr(jclass klass)
25 {
26   return 0;
27 }
28 #endif
29
30 void *
31 _Jv_AllocObj (jsize size, jclass klass)
32 {
33   total += size;
34   void *obj = calloc (size, 1);
35   *((_Jv_VTable **) obj) = klass->vtable;
36   return obj;
37 }
38
39 void *
40 _Jv_AllocArray (jsize size, jclass klass)
41 {
42   total += size;
43   void *obj = calloc (size, 1);
44   *((_Jv_VTable **) obj) = klass->vtable;
45   return obj;
46 }
47
48 void *
49 _Jv_AllocBytes (jsize size)
50 {
51   total += size;
52   return calloc (size, 1);
53 }
54
55 void
56 _Jv_RegisterFinalizer (void *, _Jv_FinalizerFunc *)
57 {
58   // FIXME: should actually register so that finalizers can be run on
59   // exit.
60 }
61
62 void
63 _Jv_RunFinalizers (void)
64 {
65 }
66
67 void
68 _Jv_RunAllFinalizers (void)
69 {
70   // FIXME: should still run all finalizers.
71 }
72
73 void
74 _Jv_RunGC (void)
75 {
76 }
77
78 long
79 _Jv_GCTotalMemory (void)
80 {
81   return total;
82 }
83
84 long
85 _Jv_GCFreeMemory (void)
86 {
87   return 0;
88 }
89
90 void
91 _Jv_GCSetInitialHeapSize (size_t size)
92 {
93 }
94
95 void
96 _Jv_GCSetMaximumHeapSize (size_t size)
97 {
98 }
99
100 void
101 _Jv_DisableGC (void)
102 {
103 }
104
105 void
106 _Jv_EnableGC (void)
107 {
108 }
109
110 void
111 _Jv_InitGC (void)
112 {
113 }