Don't check for swept blocks in -DS.
[ghc-hetmet.git] / includes / rts / storage / MBlock.h
index 03396c1..69b3742 100644 (file)
 #ifndef RTS_STORAGE_MBLOCK_H
 #define RTS_STORAGE_MBLOCK_H
 
+extern lnat peak_mblocks_allocated;
 extern lnat mblocks_allocated;
 
 extern void initMBlocks(void);
 extern void * getMBlock(void);
 extern void * getMBlocks(nat n);
+extern void freeMBlocks(void *addr, nat n);
 extern void freeAllMBlocks(void);
 
-#ifdef DEBUG
 extern void *getFirstMBlock(void);
 extern void *getNextMBlock(void *mblock);
+
+#ifdef THREADED_RTS
+// needed for HEAP_ALLOCED below
+extern SpinLock gc_alloc_block_sync;
 #endif
 
 /* -----------------------------------------------------------------------------
@@ -121,7 +126,17 @@ extern StgWord8 mblock_map[];
 
 #define MBC_LINE_BITS 0
 #define MBC_TAG_BITS 15
-typedef StgWord32 MbcCacheLine;  // could use 16, but 32 was faster
+
+#if x86_64_HOST_ARCH
+// 32bits are enough for 'entry' as modern amd64 boxes have
+// only 48bit sized virtual addres.
+typedef StgWord32 MbcCacheLine;
+#else
+// 32bits is not enough here as some arches (like ia64) use
+// upper address bits to distinct memory areas.
+typedef StgWord64 MbcCacheLine;
+#endif
+
 typedef StgWord8  MBlockMapLine;
 
 #define MBLOCK_MAP_LINE(p)  (((StgWord)p & 0xffffffff) >> (MBLOCK_SHIFT + MBC_LINE_BITS))