237 assert(nextTC->is_free(), "Should be a free chunk"); |
237 assert(nextTC->is_free(), "Should be a free chunk"); |
238 } |
238 } |
239 } else { |
239 } else { |
240 if (nextTC == NULL) { |
240 if (nextTC == NULL) { |
241 // Removing chunk at tail of list |
241 // Removing chunk at tail of list |
242 link_tail(prevFC); |
242 this->link_tail(prevFC); |
243 } |
243 } |
244 // Chunk is interior to the list |
244 // Chunk is interior to the list |
245 prevFC->link_after(nextTC); |
245 prevFC->link_after(nextTC); |
246 } |
246 } |
247 |
247 |
294 assert(head() == NULL || head()->prev() == NULL, "list invariant"); |
294 assert(head() == NULL || head()->prev() == NULL, "list invariant"); |
295 assert(tail() == NULL || tail()->next() == NULL, "list invariant"); |
295 assert(tail() == NULL || tail()->next() == NULL, "list invariant"); |
296 |
296 |
297 Chunk_t* fc = tail(); |
297 Chunk_t* fc = tail(); |
298 fc->link_after(chunk); |
298 fc->link_after(chunk); |
299 link_tail(chunk); |
299 this->link_tail(chunk); |
300 |
300 |
301 assert(!tail() || size() == tail()->size(), "Wrong sized chunk in list"); |
301 assert(!tail() || size() == tail()->size(), "Wrong sized chunk in list"); |
302 FreeList_t<Chunk_t>::increment_count(); |
302 FreeList_t<Chunk_t>::increment_count(); |
303 debug_only(increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));) |
303 debug_only(increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));) |
304 assert(head() == NULL || head()->prev() == NULL, "list invariant"); |
304 assert(head() == NULL || head()->prev() == NULL, "list invariant"); |
321 Chunk_t* fc = head()->next(); |
321 Chunk_t* fc = head()->next(); |
322 if (fc != NULL) { |
322 if (fc != NULL) { |
323 chunk->link_after(fc); |
323 chunk->link_after(fc); |
324 } else { |
324 } else { |
325 assert(tail() == NULL, "List is inconsistent"); |
325 assert(tail() == NULL, "List is inconsistent"); |
326 link_tail(chunk); |
326 this->link_tail(chunk); |
327 } |
327 } |
328 head()->link_after(chunk); |
328 head()->link_after(chunk); |
329 assert(!head() || size() == head()->size(), "Wrong sized chunk in list"); |
329 assert(!head() || size() == head()->size(), "Wrong sized chunk in list"); |
330 FreeList_t<Chunk_t>::increment_count(); |
330 FreeList_t<Chunk_t>::increment_count(); |
331 debug_only(increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));) |
331 debug_only(increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));) |
1020 class DescendTreeSearchClosure : public TreeSearchClosure<Chunk_t, FreeList_t> { |
1020 class DescendTreeSearchClosure : public TreeSearchClosure<Chunk_t, FreeList_t> { |
1021 public: |
1021 public: |
1022 bool do_tree(TreeList<Chunk_t, FreeList_t>* tl) { |
1022 bool do_tree(TreeList<Chunk_t, FreeList_t>* tl) { |
1023 if (tl != NULL) { |
1023 if (tl != NULL) { |
1024 if (do_tree(tl->right())) return true; |
1024 if (do_tree(tl->right())) return true; |
1025 if (do_list(tl)) return true; |
1025 if (this->do_list(tl)) return true; |
1026 if (do_tree(tl->left())) return true; |
1026 if (do_tree(tl->left())) return true; |
1027 } |
1027 } |
1028 return false; |
1028 return false; |
1029 } |
1029 } |
1030 }; |
1030 }; |