OSDN Git Service

1999-07-05 Bryce McKinlay <bryce@albatross.co.nz>
[pf3gnuchains/gcc-fork.git] / libjava / nogc.cc
1 // nogc.cc - Code to implement no GC.
2
3 /* Copyright (C) 1998, 1999  Cygnus Solutions
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 <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_InitGC (void)
80 {
81 }