// Fills the current tlab with a dummy filler array to create // an illusion of a contiguous Eden and optionally retires the tlab. // Waste accounting should be done in caller as appropriate; see, // for example, clear_before_allocation(). void ThreadLocalAllocBuffer::make_parsable(bool retire) { if (end() != NULL) { invariants(); CollectedHeap::fill_with_object(top(), hard_end()); if (retire || ZeroTLAB) { // "Reset" the TLAB set_start(NULL); set_top(NULL); set_pf_top(NULL); set_end(NULL); } } assert(!(retire || ZeroTLAB) || (start() == NULL && end() == NULL && top() == NULL), "TLAB must be reset"); }
size_t remaining() const { return end() == NULL ? 0 : pointer_delta(hard_end(), top()); }