[project @ 2003-01-19 18:41:19 by wolfgang]
[ghc-hetmet.git] / ghc / includes / Constants.h
index 9d66642..5ce56d9 100644 (file)
@@ -1,7 +1,7 @@
 /* ----------------------------------------------------------------------------
- * $Id: Constants.h,v 1.19 2001/11/26 16:54:22 simonmar Exp $
+ * $Id: Constants.h,v 1.22 2002/12/11 15:36:37 simonmar Exp $
  *
- * (c) The GHC Team, 1998-1999
+ * (c) The GHC Team, 1998-2002
  *
  * Constants
  *
@@ -64,6 +64,7 @@
  */
 
 #define MAX_SPEC_AP_SIZE       8
+/* ToDo: make it 8 again */
 
 /* Specialised FUN/THUNK/CONSTR closure types */
 
 /* You can change these constants (I hope) but be sure to modify
    rts/StgMiscClosures.hs accordingly. */
 
-/*---- Minimum number of words left in heap after GC to carry on */
-
-#define HEAP_HWM_WORDS 1024
-
 /* -----------------------------------------------------------------------------
    Semi-Tagging constants
 
    -------------------------------------------------------------------------- */
 
 /* The size of a block (2^BLOCK_SHIFT bytes) */
-#define BLOCK_SHIFT  11
+#define BLOCK_SHIFT  12
 
 /* The size of a megablock (2^MBLOCK_SHIFT bytes) */
 #define MBLOCK_SHIFT   20
  */
 #define LARGE_OBJECT_THRESHOLD ((nat)(BLOCK_SIZE * 8 / 10))
 
-#endif /* CONSTANTS_H */
+/* -----------------------------------------------------------------------------
+   Bitmap/size fields (used in info tables)
+   -------------------------------------------------------------------------- */
+
+/* In a 32-bit bitmap field, we use 5 bits for the size, and 27 bits
+ * for the bitmap.  If the bitmap requires more than 27 bits, then we
+ * store it in a separate array, and leave a pointer in the bitmap
+ * field.  On a 64-bit machine, the sizes are extended accordingly.
+ */
+#if SIZEOF_VOID_P == 4
+#define BITMAP_SIZE_MASK     0x1f
+#define BITMAP_BITS_SHIFT    5
+#elif SIZEOF_VOID_P == 8
+#define BITMAP_SIZE_MASK     0x3f
+#define BITMAP_BITS_SHIFT    6
+#else
+#error unknown SIZEOF_VOID_P
+#endif
 
+#endif /* CONSTANTS_H */