diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-09-07 13:55:11 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-09-07 15:32:14 +0100 |
commit | 41737f12f99c9ea776f7658b93e5b03ffc8f120b (patch) | |
tree | 76dd200a6f0e3fd8af87270ae1010985038c26a9 /includes/rts/storage/ClosureMacros.h | |
parent | a8179622f84bbd52e127a9596d2d4a918ca64e0c (diff) | |
download | haskell-41737f12f99c9ea776f7658b93e5b03ffc8f120b.tar.gz |
Deprecate lnat, and use StgWord instead
lnat was originally "long unsigned int" but we were using it when we
wanted a 64-bit type on a 64-bit machine. This broke on Windows x64,
where long == int == 32 bits. Using types of unspecified size is bad,
but what we really wanted was a type with N bits on an N-bit machine.
StgWord is exactly that.
lnat was mentioned in some APIs that clients might be using
(e.g. StackOverflowHook()), so we leave it defined but with a comment
to say that it's deprecated.
Diffstat (limited to 'includes/rts/storage/ClosureMacros.h')
-rw-r--r-- | includes/rts/storage/ClosureMacros.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h index c6b29aa5b8..146564a17f 100644 --- a/includes/rts/storage/ClosureMacros.h +++ b/includes/rts/storage/ClosureMacros.h @@ -429,20 +429,20 @@ EXTERN_INLINE StgWord stack_frame_sizeW( StgClosure *frame ) -------------------------------------------------------------------------- */ // The number of card bytes needed -INLINE_HEADER lnat mutArrPtrsCards (lnat elems) +INLINE_HEADER W_ mutArrPtrsCards (W_ elems) { - return (lnat)((elems + (1 << MUT_ARR_PTRS_CARD_BITS) - 1) + return (W_)((elems + (1 << MUT_ARR_PTRS_CARD_BITS) - 1) >> MUT_ARR_PTRS_CARD_BITS); } // The number of words in the card table -INLINE_HEADER lnat mutArrPtrsCardTableSize (lnat elems) +INLINE_HEADER W_ mutArrPtrsCardTableSize (W_ elems) { return ROUNDUP_BYTES_TO_WDS(mutArrPtrsCards(elems)); } // The address of the card for a particular card number -INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, lnat n) +INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n) { return ((StgWord8 *)&(a->payload[a->ptrs]) + n); } |