* Removed all Id tags.
[cacao.git] / src / native / vm / gnu / gnu_java_lang_management_VMMemoryMXBeanImpl.c
index 4dc96e5ccc03fd9c7eef3ce581a18ad26926ec2d..b203a73a5728fdd58cc90e68790e29dd97a3fdc0 100644 (file)
@@ -1,6 +1,6 @@
-/* src/native/vm/gnu_java_lang_management_VMMemoryMXBeanImpl.c
+/* src/native/vm/gnu/gnu_java_lang_management_VMMemoryMXBeanImpl.c
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
    J. Wenninger, Institut f. Computersprachen - TU Wien
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Christian Thalinger
-
-   Changes:
-
-   $Id: VMFrame.c 4996 2006-05-31 13:53:16Z motse $
-
 */
 
 
 #include "mm/gc-common.h"
 
 #include "native/jni.h"
+#include "native/native.h"
+
 #include "native/include/java_lang_management_MemoryUsage.h"
 
+#include "native/include/gnu_java_lang_management_VMMemoryMXBeanImpl.h"
+
 #include "vm/builtin.h"
-#include "vm/class.h"
 #include "vm/global.h"
-#include "vm/loader.h"                   /* XXX only for load_class_bootstrap */
-#include "vm/options.h"
 #include "vm/vm.h"
 
+#include "vmcore/class.h"
+#include "vmcore/loader.h"               /* XXX only for load_class_bootstrap */
+#include "vmcore/options.h"
+
+
+/* native methods implemented by this file ************************************/
+
+static JNINativeMethod methods[] = {
+       { "getHeapMemoryUsage",                "()Ljava/lang/management/MemoryUsage;", (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getHeapMemoryUsage                },
+       { "getNonHeapMemoryUsage",             "()Ljava/lang/management/MemoryUsage;", (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getNonHeapMemoryUsage             },
+       { "getObjectPendingFinalizationCount", "()I",                                  (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getObjectPendingFinalizationCount },
+       { "isVerbose",                         "()Z",                                  (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_isVerbose                         },
+       { "setVerbose",                        "(Z)V",                                 (void *) (ptrint) &Java_gnu_java_lang_management_VMMemoryMXBeanImpl_setVerbose                        },
+};
+
+
+/* _Jv_gnu_java_lang_management_VMMemoryMXBeanImpl_init ************************
+
+   Register native functions.
+
+*******************************************************************************/
+
+void _Jv_gnu_java_lang_management_VMMemoryMXBeanImpl_init(void)
+{
+       utf *u;
+
+       u = utf_new_char("gnu/java/lang/management/VMMemoryMXBeanImpl");
+
+       native_method_register(u, methods, NATIVE_METHODS_COUNT);
+}
+
 
 /*
  * Class:     gnu/java/lang/management/VMMemoryMXBeanImpl
@@ -57,7 +81,7 @@
 JNIEXPORT java_lang_management_MemoryUsage* JNICALL Java_gnu_java_lang_management_VMMemoryMXBeanImpl_getHeapMemoryUsage(JNIEnv *env, jclass clazz)
 {
        classinfo                        *class_java_lang_management_MemoryUsage;
-       java_objectheader                *o;
+       java_handle_t                    *o;
        java_lang_management_MemoryUsage *mu;
        methodinfo                       *m;
        s8                                init;