Commit b7e5d722 authored by awson's avatar awson Committed by Austin Seipp
Browse files

Fix incorrect blocksize calculation on Win64



Fixes #8839
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 623883f1
......@@ -9,16 +9,26 @@
#ifndef RTS_STORAGE_BLOCK_H
#define RTS_STORAGE_BLOCK_H
#include "ghcconfig.h"
/* The actual block and megablock-size constants are defined in
* includes/Constants.h, all constants here are derived from these.
*/
/* Block related constants (BLOCK_SHIFT is defined in Constants.h) */
#if SIZEOF_LONG == SIZEOF_VOID_P
#define UNIT 1UL
#elif SIZEOF_LONG_LONG == SIZEOF_VOID_P
#define UNIT 1ULL
#else
#error "Size of pointer is suspicious."
#endif
#ifdef CMINUSMINUS
#define BLOCK_SIZE (1<<BLOCK_SHIFT)
#else
#define BLOCK_SIZE (1UL<<BLOCK_SHIFT)
#define BLOCK_SIZE (UNIT<<BLOCK_SHIFT)
// Note [integer overflow]
#endif
......@@ -33,7 +43,7 @@
#ifdef CMINUSMINUS
#define MBLOCK_SIZE (1<<MBLOCK_SHIFT)
#else
#define MBLOCK_SIZE (1UL<<MBLOCK_SHIFT)
#define MBLOCK_SIZE (UNIT<<MBLOCK_SHIFT)
// Note [integer overflow]
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment