summaryrefslogtreecommitdiff
path: root/rts/Arena.c
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-04-27 12:01:13 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-04-27 12:01:13 +0000
commitcbeb99efd4a117de5b028341dc41bc8f50717383 (patch)
tree718b3dab5c48e29f797210702cbc2dc4d2b732ea /rts/Arena.c
parent47e0b5e52240f8794b117e0dbde4e21f41ffe9ec (diff)
downloadhaskell-cbeb99efd4a117de5b028341dc41bc8f50717383.tar.gz
Basic heap profile support without -prof
Now that constructor info tables contain the name of the constructor, we can generate useful heap profiles without requiring the whole program and libraries to be compiled with -prof. So now, "+RTS -hT" generates a heap profile for any program, dividing the profile by constructor. It wouldn't be hard to add support for grouping constructors by module, or to restrict the profile to certain constructors/modules/packages. This means that for the first time we can get heap profiles for GHCi, which was previously impossible because the byte-code interpreter and linker don't work with -prof.
Diffstat (limited to 'rts/Arena.c')
-rw-r--r--rts/Arena.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/Arena.c b/rts/Arena.c
index b2b5ce2d5a..fcdc6cce14 100644
--- a/rts/Arena.c
+++ b/rts/Arena.c
@@ -42,7 +42,7 @@ newArena( void )
Arena *arena;
arena = stgMallocBytes(sizeof(Arena), "newArena");
- arena->current = allocBlock();
+ arena->current = allocBlock_lock();
arena->current->link = NULL;
arena->free = arena->current->start;
arena->lim = arena->current->start + BLOCK_SIZE_W;
@@ -81,7 +81,7 @@ arenaAlloc( Arena *arena, size_t size )
} else {
// allocate a fresh block...
req_blocks = (lnat)BLOCK_ROUND_UP(size) / BLOCK_SIZE;
- bd = allocGroup(req_blocks);
+ bd = allocGroup_lock(req_blocks);
arena_blocks += req_blocks;
bd->gen_no = 0;
@@ -106,7 +106,7 @@ arenaFree( Arena *arena )
next = bd->link;
arena_blocks -= bd->blocks;
ASSERT(arena_blocks >= 0);
- freeGroup(bd);
+ freeGroup_lock(bd);
}
stgFree(arena);
}