8294037: Using alias template to unify hashtables in AsyncLogWriter
Reviewed-by: coleenp, simonis
This commit is contained in:
parent
48cc15602b
commit
696287d6e8
@ -116,10 +116,7 @@ AsyncLogWriter::AsyncLogWriter()
|
|||||||
|
|
||||||
void AsyncLogWriter::write() {
|
void AsyncLogWriter::write() {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
// Similar to AsyncLogMap but on resource_area
|
AsyncLogMap<ResourceObj::RESOURCE_AREA> snapshot;
|
||||||
ResourceHashtable<LogFileStreamOutput*, uint32_t,
|
|
||||||
17/*table_size*/, ResourceObj::RESOURCE_AREA,
|
|
||||||
mtLogging> snapshot;
|
|
||||||
|
|
||||||
// lock protection. This guarantees I/O jobs don't block logsites.
|
// lock protection. This guarantees I/O jobs don't block logsites.
|
||||||
{
|
{
|
||||||
|
@ -58,11 +58,12 @@ class AsyncLogWriter : public NonJavaThread {
|
|||||||
friend class AsyncLogTest;
|
friend class AsyncLogTest;
|
||||||
friend class AsyncLogTest_logBuffer_vm_Test;
|
friend class AsyncLogTest_logBuffer_vm_Test;
|
||||||
class AsyncLogLocker;
|
class AsyncLogLocker;
|
||||||
|
|
||||||
|
// account for dropped messages
|
||||||
|
template <ResourceObj::allocation_type ALLOC_TYPE>
|
||||||
using AsyncLogMap = ResourceHashtable<LogFileStreamOutput*,
|
using AsyncLogMap = ResourceHashtable<LogFileStreamOutput*,
|
||||||
uint32_t,
|
uint32_t, 17, /*table_size*/
|
||||||
17, /*table_size*/
|
ALLOC_TYPE, mtLogging>;
|
||||||
ResourceObj::C_HEAP,
|
|
||||||
mtLogging>;
|
|
||||||
|
|
||||||
// Messsage is the envelop of a log line and its associative data.
|
// Messsage is the envelop of a log line and its associative data.
|
||||||
// Its length is variable because of the zero-terminated c-str. It is only valid when we create it using placement new
|
// Its length is variable because of the zero-terminated c-str. It is only valid when we create it using placement new
|
||||||
@ -154,7 +155,7 @@ class AsyncLogWriter : public NonJavaThread {
|
|||||||
PlatformMonitor _lock;
|
PlatformMonitor _lock;
|
||||||
bool _data_available;
|
bool _data_available;
|
||||||
volatile bool _initialized;
|
volatile bool _initialized;
|
||||||
AsyncLogMap _stats; // statistics for dropped messages
|
AsyncLogMap<ResourceObj::C_HEAP> _stats;
|
||||||
|
|
||||||
// ping-pong buffers
|
// ping-pong buffers
|
||||||
Buffer* _buffer;
|
Buffer* _buffer;
|
||||||
|
Loading…
Reference in New Issue
Block a user