src/mm/memory.hpp: Switched to C++.
--HG--
rename : src/mm/memory.c => src/mm/memory.cpp
rename : src/mm/memory.h => src/mm/memory.hpp
dumpmemory.hpp \
$(GC_FILE) \
gc.hpp \
- memory.c \
- memory.h
+ memory.cpp \
+ memory.hpp
libmm_la_LIBADD = \
$(GC_LIB)
#include "gc.h"
#include "heap.h"
#include "mark.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "mark.h"
#include "region.h"
#include "rootset.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "vm/global.h"
#include "gc.h"
#include "final.h"
#include "heap.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/finalizer.hpp"
#include "mark.h"
#include "region.h"
#include "rootset.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "vm/finalizer.hpp"
#include "heap.h"
#include "mark.h"
#include "region.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/include/java_lang_String.h"
#include "native/llni.h"
#include "toolbox/logging.hpp"
#include "heap.h"
#include "mark.h"
#include "rootset.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "vm/global.h"
#include "vm/types.h"
#include "region.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "heap.h"
#include "mark.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/threadlist.h"
#include "threads/thread.hpp"
#include "threads/thread.hpp"
#include "mm/codememory.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/global.h"
#include "vm/options.h"
#include <stdint.h>
#include "mm/dumpmemory.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/thread.hpp"
// Includes.
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/thread.hpp"
#include "boehm-gc/include/gc.h"
#include "mm/gc.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "boehm-gc/include/gc.h"
#include "mm/gc.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
+++ /dev/null
-/* src/mm/memory.c - memory management
-
- Copyright (C) 1996-2005, 2006, 2007, 2008
- CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
-
- This file is part of CACAO.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
-*/
-
-
-#include "config.h"
-
-#include <assert.h>
-#include <stdint.h>
-
-#if defined(__DARWIN__)
-/* If we compile with -ansi on darwin, <sys/types.h> is not
- included. So let's do it here. */
-# include <sys/types.h>
-#endif
-
-#include "vm/types.h"
-
-#include "arch.h"
-
-#include "mm/memory.h"
-
-#include "native/native.hpp"
-
-#include "threads/lock.hpp"
-#include "threads/thread.hpp"
-
-#include "toolbox/logging.hpp"
-
-#include "vm/global.h"
-#include "vm/string.hpp"
-#include "vm/vm.hpp"
-
-#include "vm/options.h"
-#include "vm/os.hpp"
-
-#if defined(ENABLE_STATISTICS)
-# include "vm/statistics.h"
-#endif
-
-
-/* memory_mprotect *************************************************************
-
- Convenience function for mprotect. This function also does error
- checking.
-
-*******************************************************************************/
-
-void memory_mprotect(void *addr, size_t len, int prot)
-{
- if (os_mprotect(addr, len, prot) != 0)
- vm_abort_errno("memory_mprotect: os_mprotect failed");
-}
-
-
-/* memory_checked_alloc ********************************************************
-
- Allocated zeroed-out memory and does an OOM check.
-
- ERROR HANDLING:
- XXX If no memory could be allocated, this function justs *exists*.
-
-*******************************************************************************/
-
-void *memory_checked_alloc(size_t size)
-{
- /* always allocate memory zeroed out */
-
- void *p = os_calloc(size, 1);
-
- if (p == NULL)
- vm_abort("memory_checked_alloc: calloc failed: out of memory");
-
- return p;
-}
-
-
-void *mem_alloc(int32_t size)
-{
- void *m;
-
- if (size == 0)
- return NULL;
-
-#if defined(ENABLE_STATISTICS)
- if (opt_stat) {
- memoryusage += size;
-
- if (memoryusage > maxmemusage)
- maxmemusage = memoryusage;
- }
-#endif
-
- m = memory_checked_alloc(size);
-
-#if defined(ENABLE_MEMCHECK)
- /* XXX we would like to poison the memory, but callers rely on */
- /* the zeroing. This should change sooner or later. */
- /* memset(m, MEMORY_CLEAR_BYTE, size); */
-#endif
-
- return m;
-}
-
-
-void *mem_realloc(void *src, int32_t len1, int32_t len2)
-{
- void *dst;
-
- /* prevent compiler warnings */
-
- dst = NULL;
-
- if (src == NULL)
- if (len1 != 0)
- vm_abort("mem_realloc: reallocating memoryblock with address NULL, length != 0");
-
-#if defined(ENABLE_STATISTICS)
- if (opt_stat)
- memoryusage = (memoryusage - len1) + len2;
-#endif
-
-#if defined(ENABLE_MEMCHECK)
- if (len2 < len1)
- os_memset((u1*)dst + len2, MEMORY_CLEAR_BYTE, len1 - len2);
-#endif
-
- dst = realloc(src, len2);
-
- if (dst == NULL)
- vm_abort("mem_realloc: realloc failed: out of memory");
-
-#if defined(ENABLE_MEMCHECK)
- if (len2 > len1)
- os_memset((u1*)dst + len1, MEMORY_CLEAR_BYTE, len2 - len1);
-#endif
-
- return dst;
-}
-
-
-void mem_free(void *m, int32_t size)
-{
- if (!m) {
- if (size == 0)
- return;
-
- log_text("returned memoryblock with address NULL, length != 0");
- assert(0);
- }
-
-#if defined(ENABLE_STATISTICS)
- if (opt_stat)
- memoryusage -= size;
-#endif
-
-#if defined(ENABLE_MEMCHECK)
- /* destroy the contents */
- os_memset(m, MEMORY_CLEAR_BYTE, size);
-#endif
-
- os_free(m);
-}
-
-
-/* memory_thread ***************************************************************
-
- Prints regularly memory statistics.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS) && !defined(NDEBUG)
-static void memory_thread(void)
-{
- int32_t seconds;
-
- /* Prevent compiler warning. */
-
- seconds = 1;
-
- /* If both arguments are specified, use the value of
- ProfileMemoryUsage. */
-
- if (opt_ProfileGCMemoryUsage)
- seconds = opt_ProfileGCMemoryUsage;
-
- if (opt_ProfileMemoryUsage)
- seconds = opt_ProfileMemoryUsage;
-
- while (true) {
- /* sleep thread */
-
- threads_sleep(seconds * 1000, 0);
-
-# if defined(ENABLE_STATISTICS)
- /* Print current date and time (only when we print to the
- stdout). */
-
- if (!opt_ProfileMemoryUsageGNUPlot)
- statistics_print_date();
-
- /* print memory usage */
-
- if (opt_ProfileMemoryUsage)
- statistics_print_memory_usage();
-
- /* print GC memory usage */
-
- if (opt_ProfileGCMemoryUsage)
- statistics_print_gc_memory_usage();
-# endif
- }
-}
-#endif
-
-
-/* memory_start_thread *********************************************************
-
- Starts the memory profiling thread.
-
-*******************************************************************************/
-
-#if defined(ENABLE_THREADS) && !defined(NDEBUG)
-bool memory_start_thread(void)
-{
- utf *name;
-
- name = utf_new_char("Memory Profiler");
-
- /* start the memory profiling thread */
-
- if (!threads_thread_start_internal(name, memory_thread))
- return false;
-
- /* everything's ok */
-
- return true;
-}
-#endif
-
-
-/*
- * These are local overrides for various environment variables in Emacs.
- * Please do not remove this and leave it at the end of the file, where
- * Emacs will automagically detect them.
- * ---------------------------------------------------------------------
- * Local variables:
- * mode: c
- * indent-tabs-mode: t
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- * vim:noexpandtab:sw=4:ts=4:
- */
--- /dev/null
+/* src/mm/memory.cpp - memory management
+
+ Copyright (C) 1996-2005, 2006, 2007, 2008
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+ This file is part of CACAO.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+*/
+
+
+#include "config.h"
+
+#include <assert.h>
+#include <stdint.h>
+
+#if defined(__DARWIN__)
+/* If we compile with -ansi on darwin, <sys/types.h> is not
+ included. So let's do it here. */
+# include <sys/types.h>
+#endif
+
+#include "vm/types.h"
+
+#include "arch.h"
+
+#include "mm/memory.hpp"
+
+#include "native/native.hpp"
+
+#include "threads/lock.hpp"
+#include "threads/thread.hpp"
+
+#include "toolbox/logging.hpp"
+
+#include "vm/global.h"
+#include "vm/string.hpp"
+#include "vm/vm.hpp"
+
+#include "vm/options.h"
+#include "vm/os.hpp"
+
+#if defined(ENABLE_STATISTICS)
+# include "vm/statistics.h"
+#endif
+
+
+/* memory_mprotect *************************************************************
+
+ Convenience function for mprotect. This function also does error
+ checking.
+
+*******************************************************************************/
+
+void memory_mprotect(void *addr, size_t len, int prot)
+{
+ if (os::mprotect(addr, len, prot) != 0)
+ vm_abort_errno("memory_mprotect: os::mprotect failed");
+}
+
+
+/* memory_checked_alloc ********************************************************
+
+ Allocated zeroed-out memory and does an OOM check.
+
+ ERROR HANDLING:
+ XXX If no memory could be allocated, this function justs *exists*.
+
+*******************************************************************************/
+
+void *memory_checked_alloc(size_t size)
+{
+ /* always allocate memory zeroed out */
+
+ void *p = os::calloc(size, 1);
+
+ if (p == NULL)
+ vm_abort("memory_checked_alloc: calloc failed: out of memory");
+
+ return p;
+}
+
+
+void *mem_alloc(int32_t size)
+{
+ void *m;
+
+ if (size == 0)
+ return NULL;
+
+#if defined(ENABLE_STATISTICS)
+ if (opt_stat) {
+ memoryusage += size;
+
+ if (memoryusage > maxmemusage)
+ maxmemusage = memoryusage;
+ }
+#endif
+
+ m = memory_checked_alloc(size);
+
+#if defined(ENABLE_MEMCHECK)
+ /* XXX we would like to poison the memory, but callers rely on */
+ /* the zeroing. This should change sooner or later. */
+ /* memset(m, MEMORY_CLEAR_BYTE, size); */
+#endif
+
+ return m;
+}
+
+
+void *mem_realloc(void *src, int32_t len1, int32_t len2)
+{
+ void *dst;
+
+ /* prevent compiler warnings */
+
+ dst = NULL;
+
+ if (src == NULL)
+ if (len1 != 0)
+ vm_abort("mem_realloc: reallocating memoryblock with address NULL, length != 0");
+
+#if defined(ENABLE_STATISTICS)
+ if (opt_stat)
+ memoryusage = (memoryusage - len1) + len2;
+#endif
+
+#if defined(ENABLE_MEMCHECK)
+ if (len2 < len1)
+ os::memset((u1*)dst + len2, MEMORY_CLEAR_BYTE, len1 - len2);
+#endif
+
+ dst = realloc(src, len2);
+
+ if (dst == NULL)
+ vm_abort("mem_realloc: realloc failed: out of memory");
+
+#if defined(ENABLE_MEMCHECK)
+ if (len2 > len1)
+ os::memset((u1*)dst + len1, MEMORY_CLEAR_BYTE, len2 - len1);
+#endif
+
+ return dst;
+}
+
+
+void mem_free(void *m, int32_t size)
+{
+ if (!m) {
+ if (size == 0)
+ return;
+
+ log_text("returned memoryblock with address NULL, length != 0");
+ assert(0);
+ }
+
+#if defined(ENABLE_STATISTICS)
+ if (opt_stat)
+ memoryusage -= size;
+#endif
+
+#if defined(ENABLE_MEMCHECK)
+ /* destroy the contents */
+ os::memset(m, MEMORY_CLEAR_BYTE, size);
+#endif
+
+ os::free(m);
+}
+
+
+/* memory_thread ***************************************************************
+
+ Prints regularly memory statistics.
+
+*******************************************************************************/
+
+#if defined(ENABLE_THREADS) && !defined(NDEBUG)
+static void memory_thread(void)
+{
+ int32_t seconds;
+
+ /* Prevent compiler warning. */
+
+ seconds = 1;
+
+ /* If both arguments are specified, use the value of
+ ProfileMemoryUsage. */
+
+ if (opt_ProfileGCMemoryUsage)
+ seconds = opt_ProfileGCMemoryUsage;
+
+ if (opt_ProfileMemoryUsage)
+ seconds = opt_ProfileMemoryUsage;
+
+ while (true) {
+ /* sleep thread */
+
+ threads_sleep(seconds * 1000, 0);
+
+# if defined(ENABLE_STATISTICS)
+ /* Print current date and time (only when we print to the
+ stdout). */
+
+ if (!opt_ProfileMemoryUsageGNUPlot)
+ statistics_print_date();
+
+ /* print memory usage */
+
+ if (opt_ProfileMemoryUsage)
+ statistics_print_memory_usage();
+
+ /* print GC memory usage */
+
+ if (opt_ProfileGCMemoryUsage)
+ statistics_print_gc_memory_usage();
+# endif
+ }
+}
+#endif
+
+
+/* memory_start_thread *********************************************************
+
+ Starts the memory profiling thread.
+
+*******************************************************************************/
+
+#if defined(ENABLE_THREADS) && !defined(NDEBUG)
+bool memory_start_thread(void)
+{
+ utf *name;
+
+ name = utf_new_char("Memory Profiler");
+
+ /* start the memory profiling thread */
+
+ if (!threads_thread_start_internal(name, memory_thread))
+ return false;
+
+ /* everything's ok */
+
+ return true;
+}
+#endif
+
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c++
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ * vim:noexpandtab:sw=4:ts=4:
+ */
+++ /dev/null
-/* src/mm/memory.h - macros for memory management
-
- Copyright (C) 1996-2005, 2006, 2007, 2008
- CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
-
- This file is part of CACAO.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
-*/
-
-
-#ifndef _MEMORY_H
-#define _MEMORY_H
-
-#include "config.h"
-
-#include <stdint.h>
-
-
-// Align the size of memory allocations to this size.
-#define ALIGNSIZE 8
-#define MEMORY_ALIGN(pos,size) ((((pos) + (size) - 1) / (size)) * (size))
-
-
-// Constants for ENABLE_MEMCHECK.
-
-#if defined(ENABLE_MEMCHECK)
-#define MEMORY_CANARY_SIZE 16
-#define MEMORY_CANARY_FIRST_BYTE 0xca
-#define MEMORY_CLEAR_BYTE 0xa5
-#endif
-
-
-// Includes.
-#include "mm/codememory.h"
-#include "mm/dumpmemory.hpp"
-#include "mm/gc.hpp"
-
-
-/*
----------------------------- Interface description -----------------------
-
-There are two possible choices for allocating memory:
-
- 1. explicit allocating / deallocating
-
- mem_alloc ..... allocate a memory block
- mem_free ...... free a memory block
- mem_realloc ... change size of a memory block (position may change)
- mem_usage ..... amount of allocated memory
-
-There are some useful macros:
-
- NEW (type) ....... allocate memory for an element of type `type`
- FREE (ptr,type) .. free memory
-
- MNEW (type,num) .. allocate memory for an array
- MFREE (ptr,type,num) .. free memory
-
- MREALLOC (ptr,type,num1,num2) .. enlarge the array to size num2
-
--------------------------------------------------------------------------------
-
-Some more macros:
-
- MEMORY_ALIGN (pos, size) ... make pos divisible by size. always returns an
- address >= pos.
-
-
- OFFSET (s,el) ....... returns the offset of 'el' in structure 's' in bytes.
-
- MCOPY (dest,src,type,num) ... copy 'num' elements of type 'type'.
-
-
-*/
-
-#define PADDING(pos,size) (MEMORY_ALIGN((pos),(size)) - (pos))
-#define OFFSET(s,el) ((int32_t) ((ptrint) &(((s*) 0)->el)))
-
-
-#define NEW(type) ((type *) mem_alloc(sizeof(type)))
-#define FREE(ptr,type) mem_free((ptr), sizeof(type))
-
-#define MNEW(type,num) ((type *) mem_alloc(sizeof(type) * (num)))
-#define MFREE(ptr,type,num) mem_free((ptr), sizeof(type) * (num))
-
-#define MREALLOC(ptr,type,num1,num2) mem_realloc((ptr), sizeof(type) * (num1), \
- sizeof(type) * (num2))
-
-
-#define MCOPY(dest,src,type,num) memcpy((dest), (src), sizeof(type) * (num))
-#define MSET(ptr,byte,type,num) memset((ptr), (byte), sizeof(type) * (num))
-#define MZERO(ptr,type,num) MSET(ptr,0,type,num)
-#define MMOVE(dest,src,type,num) memmove((dest), (src), sizeof(type) * (num))
-
-
-/* GC macros (boehm only) *****************************************************/
-
-#if defined(ENABLE_GC_BOEHM)
-
-/* Uncollectable memory which can contain references */
-
-#define GCNEW_UNCOLLECTABLE(type,num) ((type *) heap_alloc_uncollectable(sizeof(type) * (num)))
-
-#define GCNEW(type) heap_alloc(sizeof(type), true, NULL, true)
-#define GCMNEW(type,num) heap_alloc(sizeof(type) * (num), true, NULL, true)
-
-#define GCFREE(ptr) heap_free((ptr))
-
-#endif
-
-
-/* function prototypes ********************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-bool memory_init(void);
-
-void memory_mprotect(void *addr, size_t len, int prot);
-
-void *memory_checked_alloc(size_t size);
-
-void *memory_cnew(int32_t size);
-void memory_cfree(void *p, int32_t size);
-
-void *mem_alloc(int32_t size);
-void mem_free(void *m, int32_t size);
-void *mem_realloc(void *src, int32_t len1, int32_t len2);
-
-#if defined(ENABLE_THREADS)
-bool memory_start_thread(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _MEMORY_H */
-
-
-/*
- * These are local overrides for various environment variables in Emacs.
- * Please do not remove this and leave it at the end of the file, where
- * Emacs will automagically detect them.
- * ---------------------------------------------------------------------
- * Local variables:
- * mode: c
- * indent-tabs-mode: t
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- * vim:noexpandtab:sw=4:ts=4:
- */
--- /dev/null
+/* src/mm/memory.hpp - macros for memory management
+
+ Copyright (C) 1996-2005, 2006, 2007, 2008
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+ This file is part of CACAO.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+*/
+
+
+#ifndef _MEMORY_H
+#define _MEMORY_H
+
+#include "config.h"
+
+#include <stdint.h>
+
+
+// Align the size of memory allocations to this size.
+#define ALIGNSIZE 8
+#define MEMORY_ALIGN(pos,size) ((((pos) + (size) - 1) / (size)) * (size))
+
+
+// Constants for ENABLE_MEMCHECK.
+
+#if defined(ENABLE_MEMCHECK)
+#define MEMORY_CANARY_SIZE 16
+#define MEMORY_CANARY_FIRST_BYTE 0xca
+#define MEMORY_CLEAR_BYTE 0xa5
+#endif
+
+
+// Includes.
+#include "mm/codememory.h"
+#include "mm/dumpmemory.hpp"
+#include "mm/gc.hpp"
+
+
+/*
+---------------------------- Interface description -----------------------
+
+There are two possible choices for allocating memory:
+
+ 1. explicit allocating / deallocating
+
+ mem_alloc ..... allocate a memory block
+ mem_free ...... free a memory block
+ mem_realloc ... change size of a memory block (position may change)
+ mem_usage ..... amount of allocated memory
+
+There are some useful macros:
+
+ NEW (type) ....... allocate memory for an element of type `type`
+ FREE (ptr,type) .. free memory
+
+ MNEW (type,num) .. allocate memory for an array
+ MFREE (ptr,type,num) .. free memory
+
+ MREALLOC (ptr,type,num1,num2) .. enlarge the array to size num2
+
+-------------------------------------------------------------------------------
+
+Some more macros:
+
+ MEMORY_ALIGN (pos, size) ... make pos divisible by size. always returns an
+ address >= pos.
+
+
+ OFFSET (s,el) ....... returns the offset of 'el' in structure 's' in bytes.
+
+ MCOPY (dest,src,type,num) ... copy 'num' elements of type 'type'.
+
+
+*/
+
+#define PADDING(pos,size) (MEMORY_ALIGN((pos),(size)) - (pos))
+#define OFFSET(s,el) ((int32_t) ((ptrint) &(((s*) 0)->el)))
+
+
+#define NEW(type) ((type *) mem_alloc(sizeof(type)))
+#define FREE(ptr,type) mem_free((ptr), sizeof(type))
+
+#define MNEW(type,num) ((type *) mem_alloc(sizeof(type) * (num)))
+#define MFREE(ptr,type,num) mem_free((ptr), sizeof(type) * (num))
+
+#define MREALLOC(ptr,type,num1,num2) mem_realloc((ptr), sizeof(type) * (num1), \
+ sizeof(type) * (num2))
+
+
+#define MCOPY(dest,src,type,num) memcpy((dest), (src), sizeof(type) * (num))
+#define MSET(ptr,byte,type,num) memset((ptr), (byte), sizeof(type) * (num))
+#define MZERO(ptr,type,num) MSET(ptr,0,type,num)
+#define MMOVE(dest,src,type,num) memmove((dest), (src), sizeof(type) * (num))
+
+
+/* GC macros (boehm only) *****************************************************/
+
+#if defined(ENABLE_GC_BOEHM)
+
+/* Uncollectable memory which can contain references */
+
+#define GCNEW_UNCOLLECTABLE(type,num) ((type *) heap_alloc_uncollectable(sizeof(type) * (num)))
+
+#define GCNEW(type) heap_alloc(sizeof(type), true, NULL, true)
+#define GCMNEW(type,num) heap_alloc(sizeof(type) * (num), true, NULL, true)
+
+#define GCFREE(ptr) heap_free((ptr))
+
+#endif
+
+
+/* function prototypes ********************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+bool memory_init(void);
+
+void memory_mprotect(void *addr, size_t len, int prot);
+
+void *memory_checked_alloc(size_t size);
+
+void *memory_cnew(int32_t size);
+void memory_cfree(void *p, int32_t size);
+
+void *mem_alloc(int32_t size);
+void mem_free(void *m, int32_t size);
+void *mem_realloc(void *src, int32_t len1, int32_t len2);
+
+#if defined(ENABLE_THREADS)
+bool memory_start_thread(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MEMORY_H */
+
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c++
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ * vim:noexpandtab:sw=4:ts=4:
+ */
#include "config.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "mm/tlh.h"
#include "vm/global.h"
#include "vm/types.h"
#include "mm/gc.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/llni.h"
#include "toolbox/logging.hpp"
#include "vm/options.h"
#include "vm/string.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/mutex.h"
#include "threads/thread.hpp"
#include "threads/lock.hpp"
#include <assert.h>
#include <stdint.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include <functional>
#include <map>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/native.hpp"
#include <errno.h>
#include <zlib.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/llni.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/llni.h"
#include <stdint.h>
#include <stdlib.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/native.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/native.hpp"
#include <stdint.h>
#include <sys/stat.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/llni.h"
# include <mach/mach.h>
#endif
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "mm/gc.hpp"
#include "native/jni.hpp"
#include <assert.h>
#include <stdint.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/llni.h"
#include "vm/os.hpp"
#if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
-# include "mm/memory.h"
+# include "mm/memory.hpp"
# include "native/native.hpp"
// Include this one early.
#include "native/vm/openjdk/hpi.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include INCLUDE_JVM_MD_H
#include INCLUDE_JVM_H
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "native/native.hpp"
#include "threads/atomic.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/llni.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "arch.h"
#include "mm/gc.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#if defined(ENABLE_GC_CACAO)
# include "mm/cacao-gc/gc.h"
// Includes.
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#if defined(ENABLE_GC_BOEHM)
/* We need to include Boehm's gc.h here for GC_register_my_thread and
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/mutex.hpp"
#include "config.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include "config.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/mutex.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/thread.hpp"
#include "toolbox/set.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/global.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/vm.hpp"
*/
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/worklist.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "native/llni.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include <cstddef>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/list.hpp"
#include "arch.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "threads/mutex.hpp"
#include "md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/descriptor.hpp"
#include "vm/exceptions.hpp"
#include "md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "native/native.hpp"
#include <stdint.h>
#include <stdio.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/condition.hpp"
#include "threads/mutex.hpp"
#include <stdint.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "toolbox/worklist.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "arch.h"
#include "md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/builtin.hpp"
#include "vm/exceptions.hpp"
#include "vm/jit/alpha/arch.h"
#include "vm/jit/alpha/codegen.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
#include "vm/jit/alpha/codegen.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "vm/jit/alpha/md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "arch.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "vm/jit/arm/arch.h"
#include "vm/jit/arm/codegen.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
#include "vm/jit/arm/codegen.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "vm/jit/arm/md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#endif
#include "mm/gc.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include <assert.h>
#include <stdint.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/global.h"
#include "arch.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/options.h"
#include "vm/vm.hpp"
#include "md.h"
#include "md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/avl.h"
#include "toolbox/list.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/disass.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/options.h"
#include <assert.h>
#include <stdint.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/code.hpp"
#include "vm/jit/exceptiontable.h"
#include "vm/jit/i386/codegen.h"
#include "vm/jit/i386/emit.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
#include "vm/jit/i386/emit.h"
#include "vm/jit/i386/md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "vm/jit/i386/codegen.h"
#include "vm/jit/i386/md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "threads/mutex.hpp"
#include "vm/jit/intrp/codegen.h"
#include "vm/jit/intrp/intrp.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "md-abi.h" /* required for TRACE_ARGS_NUM */
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/thread.hpp"
#include "config.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include <algorithm>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/list.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "vm/jit/jit.hpp"
#include <assert.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "vm/jit/jit.hpp"
#include "vm/jit/loop/graph.h"
/* #include <stdio.h> */
#include <stdlib.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "vm/global.h"
#include "vm/jit/jit.hpp"
*/
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/builtin.hpp"
#include "vm/resolve.hpp"
#include "vm/jit/loop/loop.h"
#include "vm/jit/m68k/codegen.h"
#include "vm/jit/m68k/emit.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
#include "vm/jit/m68k/codegen.h"
#include "vm/jit/m68k/emit.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/builtin.hpp"
#include "vm/jit/m68k/md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "vm/jit/builtin.hpp"
#include <stdint.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/avl.h"
#include "vm/jit/mips/arch.h"
#include "vm/jit/mips/codegen.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
#include "vm/jit/mips/codegen.h"
#include "vm/jit/mips/md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "vm/jit/mips/md-abi.h"
#include "mm/gc.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/signallocal.h"
#include "vm/os.hpp"
#include "vm/jit/mips/md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/descriptor.hpp"
#include "vm/global.h"
#include "vm/jit/mips/codegen.h"
#include "vm/jit/mips/md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "config.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/code.hpp"
#include "vm/jit/oprofile-agent.hpp"
#include <stdint.h>
#include "mm/dumpmemory.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include "config.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include "config.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include <stdio.h>
#include <stdlib.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include "toolbox/worklist.h"
#include "arch.h"
#include "md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/threadlist.hpp"
#include "threads/thread.hpp"
#include <assert.h>
#include <stdint.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/condition.hpp"
#include "threads/mutex.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/jit.hpp"
#include <stdio.h>
#include <stdlib.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include "toolbox/worklist.h"
#include "config.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include "toolbox/set.h"
#include "vm/jit/jit.hpp"
#include "vm/global.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "mm/dumpmemory.hpp"
#include "toolbox/list.hpp"
#include <stdio.h>
#include <stdlib.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include "toolbox/worklist.h"
#include <stdio.h>
#include <stdlib.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/bitvector.h"
#include "toolbox/worklist.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "codegen.h" /* for PATCHER_NOPS */
#include "md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "vm/jit/powerpc/arch.h"
#include "vm/jit/powerpc/codegen.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
#include "vm/jit/powerpc/codegen.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "vm/jit/powerpc/md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "vm/jit/powerpc64/arch.h"
#include "vm/jit/powerpc64/codegen.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "md-abi.h"
#include "vm/jit/powerpc64/codegen.h"
#include "vm/jit/powerpc64/md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "arch.h"
#include "md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/abi.h"
#include "vm/jit/reg.h"
#endif
#include "mm/dumpmemory.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/thread.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "vm/jit/s390/emit.h"
#include "vm/jit/s390/md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include <assert.h>
#include <stdint.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "vm/jit/builtin.hpp"
#include "disass.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/options.h"
#include "vm/statistics.h"
#include "vm/jit/schedule/schedule.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "vm/jit/sparc64/codegen.h"
#include "vm/jit/sparc64/emit.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
#include "vm/jit/sparc64/md-abi.h"
#include "vm/jit/sparc64/emit.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/builtin.hpp"
#include "vm/options.h"
#include "vm/jit/stack.h"
/* temp */
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include <assert.h>
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/sparc64/codegen.h"
#include "vm/jit/sparc64/md.h"
#include "arch.h"
#include "md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "md.h"
#include "mm/gc.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/jit/stacktrace.hpp"
#include "arch.h"
#include "md-abi.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "md.h"
#include "md-trap.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "vm/types.h"
#include "vm/jit/builtin.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/array.hpp"
#include "vm/exceptions.hpp"
#include <assert.h>
#include <string.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#ifdef ENABLE_VERIFIER
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include <assert.h>
#include <string.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "toolbox/logging.hpp"
#include "vm/jit/x86_64/codegen.h"
#include "vm/jit/x86_64/emit.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/localref.hpp"
#include "native/native.hpp"
#include "vm/jit/x86_64/codegen.h"
#include "vm/jit/x86_64/emit.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/lock.hpp"
#include "vm/jit/x86_64/codegen.h"
#include "vm/jit/x86_64/md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/native.hpp"
#include "vm/types.h"
#include "mm/dumpmemory.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include <stdio.h>
#include <stdlib.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/options.h"
#include "vm/os.hpp"
#include <stdint.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/options.h"
#include "vm/package.hpp"
#include <unistd.h>
#include <sys/utsname.h>
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/access.hpp"
#include "vm/classcache.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/global.h"
#include "vm/rt-timing.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/global.h"
#include "arch.h"
#if defined(ENABLE_GC_BOEHM)
-# include "mm/memory.h"
+# include "mm/memory.hpp"
#endif
#include "threads/thread.hpp"
#include "config.h"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/class.hpp"
#include "vm/exceptions.hpp"
#include "vm/global.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/llni.h"
#include "arch.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/mutex.hpp"
#include "vm/types.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/mutex.hpp"
#include "mm/codememory.h"
#include "mm/dumpmemory.hpp"
#include "mm/gc.hpp"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "native/jni.hpp"
#include "native/llni.h"
_jnienv = new JNIEnv();
#if defined(ENABLE_JNI)
- _jnienv->functions = &_Jv_JNINativeInterface;
+ _jnienv->p = &_Jv_JNINativeInterface;
#endif
/* actually create the JVM */
#include "vm/descriptor.hpp" /* needed to prevent circular dependency */
#include "toolbox/hashtable.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "vm/global.h"
#include "vm/suck.hpp"