mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8202994: Add support for undoing last TLAB allocation
Reviewed-by: shade, stefank
This commit is contained in:
parent
d822b86df8
commit
a6b12a847c
2 changed files with 18 additions and 0 deletions
|
@ -53,6 +53,19 @@ inline HeapWord* ThreadLocalAllocBuffer::allocate(size_t size) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
inline bool ThreadLocalAllocBuffer::undo_allocate(HeapWord* obj, size_t size) {
|
||||
invariants();
|
||||
|
||||
if (!is_last_allocation(obj, size)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
set_top(obj);
|
||||
|
||||
invariants();
|
||||
return true;
|
||||
}
|
||||
|
||||
inline size_t ThreadLocalAllocBuffer::compute_size(size_t obj_size) {
|
||||
// Compute the size for the new TLAB.
|
||||
// The "last" tlab may be smaller to reduce fragmentation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue