I don't think this can ever be useful, because to add more roots you
need to do it consistently for every GC. The right way to add roots
is to use newStablePtr.
extern void performGC(void);
extern void performMajorGC(void);
extern void performGC(void);
extern void performMajorGC(void);
-extern void performGCWithRoots(void (*get_roots)(evac_fn));
extern HsInt64 getAllocations( void );
extern void revertCAFs( void );
extern void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p);
extern HsInt64 getAllocations( void );
extern void revertCAFs( void );
extern void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p);
This is the interface to the garbage collector from Haskell land.
We provide this so that external C code can allocate and garbage
collect when called from Haskell via _ccall_GC.
This is the interface to the garbage collector from Haskell land.
We provide this so that external C code can allocate and garbage
collect when called from Haskell via _ccall_GC.
-
- It might be useful to provide an interface whereby the programmer
- can specify more roots (ToDo).
-
- This needs to be protected by the GC condition variable above. KH.
-------------------------------------------------------------------------- */
static void (*extra_roots)(evac_fn);
-------------------------------------------------------------------------- */
static void (*extra_roots)(evac_fn);
extra_roots(evac); // the user's roots
}
extra_roots(evac); // the user's roots
}
-void
-performGCWithRoots(void (*get_roots)(evac_fn))
-{
- extra_roots = get_roots;
- performGC_(rtsFalse, AllRoots);
-}
-
/* -----------------------------------------------------------------------------
Stack overflow
/* -----------------------------------------------------------------------------
Stack overflow