1 // nogc.cc - Implement null garbage collector.
3 /* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
19 // Total amount of memory allocated.
20 static long total
= 0;
23 _Jv_BuildGCDescr(jclass
)
29 _Jv_AllocObj (jsize size
, jclass klass
)
32 void *obj
= calloc (size
, 1);
33 if (!obj
) _Jv_ThrowNoMemory();
34 *((_Jv_VTable
**) obj
) = klass
->vtable
;
39 _Jv_AllocPtrFreeObj (jsize size
, jclass klass
)
42 void *obj
= calloc (size
, 1);
43 if (!obj
) _Jv_ThrowNoMemory();
44 *((_Jv_VTable
**) obj
) = klass
->vtable
;
49 _Jv_AllocArray (jsize size
, jclass klass
)
52 void *obj
= calloc (size
, 1);
53 if (!obj
) _Jv_ThrowNoMemory();
54 *((_Jv_VTable
**) obj
) = klass
->vtable
;
59 _Jv_AllocBytes (jsize size
)
62 void *obj
= calloc (size
, 1);
63 if (!obj
) _Jv_ThrowNoMemory();
68 _Jv_AllocRawObj (jsize size
)
71 return calloc (size
, 1);
75 _Jv_RegisterFinalizer (void *, _Jv_FinalizerFunc
*)
77 // FIXME: should actually register so that finalizers can be run on
82 _Jv_RunFinalizers (void)
87 _Jv_RunAllFinalizers (void)
89 // FIXME: should still run all finalizers.
93 _Jv_GCInitializeFinalizers (void (*) (void))
103 _Jv_GCTotalMemory (void)
109 _Jv_GCFreeMemory (void)
115 _Jv_GCSetInitialHeapSize (size_t)
120 _Jv_GCSetMaximumHeapSize (size_t)
140 _Jv_GCRegisterDisappearingLink (jobject
*)
145 _Jv_GCCanReclaimSoftReference (jobject
)
147 // For now, always reclaim soft references. FIXME.
151 #ifdef JV_HASH_SYNCHRONIZATION
153 _Jv_AllocTraceOne (jsize size
/* includes vtable slot */)
155 void *obj
= calloc(size
, 1);
156 if (!obj
) _Jv_ThrowNoMemory();
161 _Jv_AllocTraceTwo (jsize size
/* includes vtable slot */)
163 void *obj
= calloc(size
, 1);
164 if (!obj
) _Jv_ThrowNoMemory();
167 #endif /* JV_HASH_SYNCHRONIZATION */