summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-08-25 11:31:50 +0100
committerIan Lynagh <ian@well-typed.com>2012-08-25 11:31:50 +0100
commit8413d83859ee0120e52bb1b3cd775b7344b52c76 (patch)
tree4a4280e8065955b3e08b303fa416587990b68824 /rts
parent75f2e87bd7b6b8c0143addc59abfe68456e59591 (diff)
downloadhaskell-8413d83859ee0120e52bb1b3cd775b7344b52c76.tar.gz
Make a function for get_itbl, rather than using a CPP macro
This has several advantages: * It can be called from gdb * There is more type information for the user, and type checking for the compiler * Less opportunity for things to go wrong, e.g. due to missing parentheses or repeated execution The sizes of the non-debug .o files hasn't changed (other than Inlines.o), so I'm pretty sure the compiled code is identical.
Diffstat (limited to 'rts')
-rw-r--r--rts/Printer.c2
-rw-r--r--rts/RaiseAsync.c2
-rw-r--r--rts/sm/MarkWeak.c4
-rw-r--r--rts/sm/Sanity.c8
4 files changed, 8 insertions, 8 deletions
diff --git a/rts/Printer.c b/rts/Printer.c
index a7ce367833..737fba4f20 100644
--- a/rts/Printer.c
+++ b/rts/Printer.c
@@ -91,7 +91,7 @@ printThunkPayload( StgThunk *obj )
StgWord i, j;
const StgInfoTable* info;
- info = get_itbl(obj);
+ info = get_itbl((StgClosure *)obj);
for (i = 0; i < info->layout.payload.ptrs; ++i) {
debugBelch(", ");
printPtr((StgPtr)obj->payload[i]);
diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c
index 9e5a8c3b2f..47d88068bf 100644
--- a/rts/RaiseAsync.c
+++ b/rts/RaiseAsync.c
@@ -306,7 +306,7 @@ check_target:
// ASSUMPTION: tso->block_info must always point to a
// closure. In the threaded RTS it does.
- switch (get_itbl(mvar)->type) {
+ switch (get_itbl((StgClosure *)mvar)->type) {
case MVAR_CLEAN:
case MVAR_DIRTY:
break;
diff --git a/rts/sm/MarkWeak.c b/rts/sm/MarkWeak.c
index b7d6226ee7..d57f7a094b 100644
--- a/rts/sm/MarkWeak.c
+++ b/rts/sm/MarkWeak.c
@@ -127,7 +127,7 @@ traverseWeakPtrList(void)
continue;
}
- info = get_itbl(w);
+ info = get_itbl((StgClosure *)w);
switch (info->type) {
case WEAK:
@@ -269,7 +269,7 @@ static rtsBool tidyThreadList (generation *gen)
t = tmp;
}
- ASSERT(get_itbl(t)->type == TSO);
+ ASSERT(get_itbl((StgClosure *)t)->type == TSO);
next = t->global_link;
// if the thread is not masking exceptions but there are
diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c
index 9a22dcb328..99cea93d2e 100644
--- a/rts/sm/Sanity.c
+++ b/rts/sm/Sanity.c
@@ -328,12 +328,12 @@ checkClosure( StgClosure* p )
// ASSERT(get_itbl(bq->bh)->type == BLACKHOLE);
ASSERT(LOOKS_LIKE_CLOSURE_PTR(bq->bh));
- ASSERT(get_itbl(bq->owner)->type == TSO);
+ ASSERT(get_itbl((StgClosure *)(bq->owner))->type == TSO);
ASSERT(bq->queue == (MessageBlackHole*)END_TSO_QUEUE
|| bq->queue->header.info == &stg_MSG_BLACKHOLE_info);
ASSERT(bq->link == (StgBlockingQueue*)END_TSO_QUEUE ||
- get_itbl(bq->link)->type == IND ||
- get_itbl(bq->link)->type == BLOCKING_QUEUE);
+ get_itbl((StgClosure *)(bq->link))->type == IND ||
+ get_itbl((StgClosure *)(bq->link))->type == BLOCKING_QUEUE);
return sizeofW(StgBlockingQueue);
}
@@ -567,7 +567,7 @@ checkGlobalTSOList (rtsBool checkTSOs)
for (tso=generations[g].threads; tso != END_TSO_QUEUE;
tso = tso->global_link) {
ASSERT(LOOKS_LIKE_CLOSURE_PTR(tso));
- ASSERT(get_itbl(tso)->type == TSO);
+ ASSERT(get_itbl((StgClosure *)tso)->type == TSO);
if (checkTSOs)
checkTSO(tso);