--- old/src/hotspot/share/gc/shared/workerDataArray.inline.hpp 2019-12-05 11:25:16.699524101 +0100 +++ new/src/hotspot/share/gc/shared/workerDataArray.inline.hpp 2019-12-05 11:25:16.353513366 +0100 @@ -30,7 +30,7 @@ #include "utilities/ostream.hpp" template -WorkerDataArray::WorkerDataArray(uint length, const char* title, bool is_serial) : +WorkerDataArray::WorkerDataArray(const char* title, uint length, bool is_serial) : _data(NULL), _length(length), _title(title), @@ -66,9 +66,11 @@ } template -void WorkerDataArray::link_thread_work_items(WorkerDataArray* thread_work_items, uint index) { +void WorkerDataArray::create_thread_work_items(const char* title, uint index, uint length_override) { assert(index < MaxThreadWorkItems, "Tried to access thread work item %u (max %u)", index, MaxThreadWorkItems); - _thread_work_items[index] = thread_work_items; + assert(_thread_work_items[index] == NULL, "Tried to overwrite existing thread work item"); + uint length = length_override != 0 ? length_override : _length; + _thread_work_items[index] = new WorkerDataArray(title, length); } template