OSDN Git Service

2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
[pf3gnuchains/gcc-fork.git] / libjava / nogc.cc
1 // nogc.cc - Code to implement no GC.
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 void *
23 _Jv_AllocObj (jsize size)
24 {
25   total += size;
26   return calloc (size, 1);
27 }
28
29 void *
30 _Jv_AllocArray (jsize size)
31 {
32   total += size;
33   return calloc (size, 1);
34 }
35
36 void *
37 _Jv_AllocBytes (jsize size)
38 {
39   total += size;
40   return calloc (size, 1);
41 }
42
43 void
44 _Jv_RegisterFinalizer (void *, _Jv_FinalizerFunc *)
45 {
46   // FIXME: should actually register so that finalizers can be run on
47   // exit.
48 }
49
50 void
51 _Jv_RunFinalizers (void)
52 {
53 }
54
55 void
56 _Jv_RunAllFinalizers (void)
57 {
58   // FIXME: should still run all finalizers.
59 }
60
61 void
62 _Jv_RunGC (void)
63 {
64 }
65
66 long
67 _Jv_GCTotalMemory (void)
68 {
69   return total;
70 }
71
72 long
73 _Jv_GCFreeMemory (void)
74 {
75   return 0;
76 }
77
78 void
79 _Jv_GCSetInitialHeapSize (size_t size)
80 {
81 }
82
83 void
84 _Jv_GCSetMaximumHeapSize (size_t size)
85 {
86 }
87
88 void
89 _Jv_DisableGC (void)
90 {
91 }
92
93 void
94 _Jv_EnableGC (void)
95 {
96 }
97
98 void
99 _Jv_InitGC (void)
100 {
101 }