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 /rts/hooks | |
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 'rts/hooks')
-rw-r--r-- | rts/hooks/MallocFail.c | 2 | ||||
-rw-r--r-- | rts/hooks/OutOfHeap.c | 2 | ||||
-rw-r--r-- | rts/hooks/StackOverflow.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/rts/hooks/MallocFail.c b/rts/hooks/MallocFail.c index e298c2ee77..6280b2f21d 100644 --- a/rts/hooks/MallocFail.c +++ b/rts/hooks/MallocFail.c @@ -10,7 +10,7 @@ #include <stdio.h> void -MallocFailHook (lnat request_size /* in bytes */, char *msg) +MallocFailHook (W_ request_size /* in bytes */, char *msg) { fprintf(stderr, "malloc: failed on request for %" FMT_SizeT " bytes; message: %s\n", request_size, msg); } diff --git a/rts/hooks/OutOfHeap.c b/rts/hooks/OutOfHeap.c index 5ed5ed9b96..b54a08a6e8 100644 --- a/rts/hooks/OutOfHeap.c +++ b/rts/hooks/OutOfHeap.c @@ -9,7 +9,7 @@ #include <stdio.h> void -OutOfHeapHook (lnat request_size, lnat heap_size) /* both sizes in bytes */ +OutOfHeapHook (W_ request_size, W_ heap_size) /* both sizes in bytes */ { /* fprintf(stderr, "Heap exhausted;\nwhile trying to allocate %lu bytes in a %lu-byte heap;\nuse `+RTS -H<size>' to increase the total heap size.\n", */ diff --git a/rts/hooks/StackOverflow.c b/rts/hooks/StackOverflow.c index fe8a059b7f..6a58bb8864 100644 --- a/rts/hooks/StackOverflow.c +++ b/rts/hooks/StackOverflow.c @@ -10,7 +10,7 @@ #include <stdio.h> void -StackOverflowHook (lnat stack_size) /* in bytes */ +StackOverflowHook (W_ stack_size) /* in bytes */ { fprintf(stderr, "Stack space overflow: current size %" FMT_SizeT " bytes.\nUse `+RTS -Ksize -RTS' to increase it.\n", stack_size); } |