void runtime·bgsweep(void);
static FuncVal bgsweepv = {runtime·bgsweep};
-struct {
+typedef struct WorkData WorkData;
+struct WorkData {
uint64 full; // lock-free list of full blocks
uint64 empty; // lock-free list of empty blocks
byte pad0[CacheLineSize]; // prevents false-sharing between full/empty and nproc/nwait
// Copy of mheap.allspans for marker or sweeper.
MSpan** spans;
uint32 nspan;
-} runtime·work;
+};
+WorkData runtime·work;
// scanblock scans a block of n bytes starting at pointer b for references
// to other objects, scanning any it finds recursively until there are no
// State of background runtime·sweep.
// Protected by runtime·gclock.
-struct
+typedef struct SweepData SweepData;
+struct SweepData
{
G* g;
bool parked;
uint32 nbgsweep;
uint32 npausesweep;
-} runtime·sweep;
+};
+SweepData runtime·sweep;
// sweeps one span
// returns number of pages returned to heap, or -1 if there is nothing to sweep