ghc-dup: 639cacad43faf8a38fe9ef886157d2b4590ddf95
1: #include "Rts.h"
2:
3: // Not available in GHCi
4: //char * info_type ( StgClosure *closure );
5: //extern void printObj ( StgClosure *obj );
6:
7: StgWord dupClosureSize(StgClosure *closure) {
8: ASSERT(LOOKS_LIKE_CLOSURE_PTR(closure));
9: return closure_sizeW(closure);
10: }
11:
12: StgWord dupHeapAlloced (StgClosure *closure) {
13: ASSERT(LOOKS_LIKE_CLOSURE_PTR(closure));
14: //return HEAP_ALLOCED(closure); does not work in GHCI
15: return !closure_STATIC(closure);
16: }
17:
18: void dupStaticWarning(StgClosure *closure) {
19: fprintf(stderr,"Static closure passed to dup!\n");
20: //fprintf(stderr,"Type: %s\n", info_type(closure));
21: // printObj(closure);
22: }
23:
24: void dupUnsupportedWarning(StgClosure *closure) {
25: fprintf(stderr,"Closure of nun-dupable type %d passed to dup!\n", get_itbl(closure)->type);
26: }
27:
28: void dupDebugPtr(StgWord word) {
29: fprintf(stderr,"dupDebugPtr %p\n", word);
30: }
Generated by git2html.