// Free the list of objects back into the central free list c. // Called from runtime·free. void runtime·MCentral_FreeList(MCentral *c, MLink *start) { MLink *next; runtime·lock(c); for(; start != nil; start = next) { next = start->next; MCentral_Free(c, start); } runtime·unlock(c); }
// Free the list of objects back into the central free list c. // Called from runtime_free. void runtime_MCentral_FreeList(MCentral *c, MLink *start) { MLink *next; runtime_lock(&c->lock); for(; start != nil; start = next) { next = start->next; MCentral_Free(c, start); } runtime_unlock(&c->lock); }
// Free n objects back into the central free list. // Return the number of objects allocated. // The objects are linked together by their first words. // On return, *pstart points at the first object and *pend at the last. void runtime_MCentral_FreeList(MCentral *c, int32 n, MLink *start) { MLink *v, *next; // Assume next == nil marks end of list. // n and end would be useful if we implemented // the transfer cache optimization in the TODO above. USED(n); runtime_lock(c); for(v=start; v; v=next) { next = v->next; MCentral_Free(c, v); } runtime_unlock(c); }