254 "Wrong type of chunk?"); |
254 "Wrong type of chunk?"); |
255 return TreeChunk::as_TreeChunk(head()); |
255 return TreeChunk::as_TreeChunk(head()); |
256 } |
256 } |
257 |
257 |
258 TreeChunk* TreeList::first_available() { |
258 TreeChunk* TreeList::first_available() { |
259 guarantee(head() != NULL, "The head of the list cannot be NULL"); |
259 assert(head() != NULL, "The head of the list cannot be NULL"); |
260 FreeChunk* fc = head()->next(); |
260 FreeChunk* fc = head()->next(); |
261 TreeChunk* retTC; |
261 TreeChunk* retTC; |
262 if (fc == NULL) { |
262 if (fc == NULL) { |
263 retTC = head_as_TreeChunk(); |
263 retTC = head_as_TreeChunk(); |
264 } else { |
264 } else { |
270 |
270 |
271 // Returns the block with the largest heap address amongst |
271 // Returns the block with the largest heap address amongst |
272 // those in the list for this size; potentially slow and expensive, |
272 // those in the list for this size; potentially slow and expensive, |
273 // use with caution! |
273 // use with caution! |
274 TreeChunk* TreeList::largest_address() { |
274 TreeChunk* TreeList::largest_address() { |
275 guarantee(head() != NULL, "The head of the list cannot be NULL"); |
275 assert(head() != NULL, "The head of the list cannot be NULL"); |
276 FreeChunk* fc = head()->next(); |
276 FreeChunk* fc = head()->next(); |
277 TreeChunk* retTC; |
277 TreeChunk* retTC; |
278 if (fc == NULL) { |
278 if (fc == NULL) { |
279 retTC = head_as_TreeChunk(); |
279 retTC = head_as_TreeChunk(); |
280 } else { |
280 } else { |