summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Rapp <tobias.rapp@student.kit.edu>2013-08-28 14:05:32 +0200
committerTobias Rapp <tobias.rapp@student.kit.edu>2013-08-28 14:05:32 +0200
commitc2dea0d7d521df7192e4493ff8f93bb74502111c (patch)
tree05cc4f05e6cfb4e1c5594e1e83ecf0075d1f3315
parentbb3778f786a91e276788f32f90ed7b18c3e0eb3d (diff)
Adopted new OctoPOS memory interface. HBLKSIZE is now 4K
-rw-r--r--include/private/gcconfig.h4
-rw-r--r--misc.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index e206d03..ef2b3a3 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -547,7 +547,7 @@
# define STRTOULL /* no implementation */
# define GC_NO_FINALIZATION
-# define HBLKSIZE 512
+# define HBLKSIZE 4096
# include "octopos.h"
# endif
@@ -2911,7 +2911,7 @@
void *ps3_get_mem(size_t size);
# define GET_MEM(bytes) (struct hblk*)ps3_get_mem(bytes)
# elif defined(OCTOPOS)
-# define GET_MEM(bytes) (struct hblk*)mem_allocate(MEM_SHM, bytes);
+# define GET_MEM(bytes) (struct hblk*)mem_map(MEM_SHM, bytes);
# else
ptr_t GC_unix_get_mem(GC_word bytes);
# define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes)
diff --git a/misc.c b/misc.c
index cda2213..d6a85a7 100644
--- a/misc.c
+++ b/misc.c
@@ -879,6 +879,12 @@ GC_API void GC_CALL GC_init(void)
InitializeCriticalSection(&GC_write_cs);
# endif
+ /* OctoPOS initialization */
+# if defined(OCTOPOS)
+ /* OctoPOS page size must be 4K */
+ GC_ASSERT(mem_get_page_size() == 4096);
+# endif
+
# if defined(GC_OCTOPOS_THREADS)
simple_spinlock_init(&GC_allocate_ml);
# endif