X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FGC.h;h=f98e4a1535ca54aa5a0c556b404d63b2546183fb;hb=2aa877f8588da099351ef51efca3605fd87ea768;hp=5d7924ea6beca2d67f0fb6587b796bce0b7fdb37;hpb=a84385fa752d8fa800a2155cce95f47c68b74e2b;p=ghc-hetmet.git diff --git a/rts/sm/GC.h b/rts/sm/GC.h index 5d7924e..f98e4a1 100644 --- a/rts/sm/GC.h +++ b/rts/sm/GC.h @@ -82,6 +82,9 @@ typedef struct step_workspace_ { // where objects to be scavenged go bdescr * todo_bd; + StgPtr todo_free; // free ptr for todo_bd + StgPtr todo_lim; // lim for todo_bd + bdescr * buffer_todo_bd; // buffer to reduce contention // on the step's todos list @@ -113,8 +116,6 @@ typedef struct gc_thread_ { #endif nat thread_index; // a zero based index identifying the thread - step_workspace ** steps; // 2-d array (gen,step) of workspaces - bdescr * free_blocks; // a buffer of free blocks for this thread // during GC without accessing the block // allocators spin lock. @@ -132,9 +133,9 @@ typedef struct gc_thread_ { // optimise it into a per-thread // variable). - rtsBool failed_to_evac; // failue to evacuate an object typically - // causes it to be recorded in the mutable - // object list + rtsBool failed_to_evac; // failure to evacuate an object typically + // causes it to be recorded in the mutable + // object list rtsBool eager_promotion; // forces promotion to the evac gen // instead of the to-space @@ -145,13 +146,22 @@ typedef struct gc_thread_ { #ifdef USE_PAPI int papi_events; #endif - + + // ------------------- + // workspaces + + // array of workspaces, indexed by stp->abs_no. This is placed + // directly at the end of the gc_thread structure so that we can get from + // the gc_thread pointer to a workspace using only pointer + // arithmetic, no memory access. This happens in the inner loop + // of the GC, see Evac.c:alloc_for_copy(). + step_workspace steps[]; } gc_thread; extern nat N; extern rtsBool major_gc; -extern gc_thread *gc_threads; +extern gc_thread **gc_threads; register gc_thread *gct __asm__("%rbx"); // extern gc_thread *gct; // this thread's gct TODO: make thread-local @@ -168,7 +178,6 @@ extern bdescr *oldgen_scan_bd; extern StgPtr oldgen_scan; extern long copied; -extern long scavd_copied; #ifdef THREADED_RTS extern SpinLock static_objects_sync;