diff options
-rw-r--r-- | rts/sm/Sanity.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index 2329b02016..c09e28c0aa 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -32,11 +32,13 @@ #include "sm/NonMoving.h" #include "sm/NonMovingMark.h" #include "Profiling.h" // prof_arena +#include "HeapAlloc.h" /* ----------------------------------------------------------------------------- Forward decls. -------------------------------------------------------------------------- */ +int isHeapAlloced ( StgPtr p); static void checkSmallBitmap ( StgPtr payload, StgWord bitmap, uint32_t ); static void checkLargeBitmap ( StgPtr payload, StgLargeBitmap*, uint32_t ); static void checkClosureShallow ( const StgClosure * ); @@ -46,6 +48,13 @@ static W_ countNonMovingSegments ( struct NonmovingSegment *segs ); static W_ countNonMovingHeap ( struct NonmovingHeap *heap ); /* ----------------------------------------------------------------------------- + Debugging utility. + -------------------------------------------------------------------------- */ + +// the HEAP_ALLOCED macro in function form. Useful for use in GDB or similar. +int isHeapAlloced ( StgPtr p) { return HEAP_ALLOCED(p); } + +/* ----------------------------------------------------------------------------- Check stack sanity -------------------------------------------------------------------------- */ |