projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2cf1115
)
findSlop: useful function for tracking down excessive slop in gdb
author
simonmar@microsoft.com
<unknown>
Fri, 14 Dec 2007 13:59:09 +0000
(13:59 +0000)
committer
simonmar@microsoft.com
<unknown>
Fri, 14 Dec 2007 13:59:09 +0000
(13:59 +0000)
rts/sm/Storage.c
patch
|
blob
|
history
diff --git
a/rts/sm/Storage.c
b/rts/sm/Storage.c
index
ecd9b54
..
2305996
100644
(file)
--- a/
rts/sm/Storage.c
+++ b/
rts/sm/Storage.c
@@
-1118,6
+1118,21
@@
void freeExec (void *addr)
#ifdef DEBUG
+// Useful for finding partially full blocks in gdb
+void findSlop(bdescr *bd);
+void findSlop(bdescr *bd)
+{
+ lnat slop;
+
+ for (; bd != NULL; bd = bd->link) {
+ slop = (bd->blocks * BLOCK_SIZE_W) - (bd->free - bd->start);
+ if (slop > (1024/sizeof(W_))) {
+ debugBelch("block at %p (bdescr %p) has %ldKB slop\n",
+ bd->start, bd, slop / (1024/sizeof(W_)));
+ }
+ }
+}
+
nat
countBlocks(bdescr *bd)
{