src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.inline.hpp
changeset 58863 c16ac7a2eba4
parent 54964 ec7d6d8effc7
equal deleted inserted replaced
58861:2c3cc4b01880 58863:c16ac7a2eba4
    29 #include "runtime/thread.inline.hpp"
    29 #include "runtime/thread.inline.hpp"
    30 
    30 
    31 template <typename T>
    31 template <typename T>
    32 inline bool UnBufferedWriteToChunk<T>::write(T* t, const u1* data, size_t size) {
    32 inline bool UnBufferedWriteToChunk<T>::write(T* t, const u1* data, size_t size) {
    33   _writer.write_unbuffered(data, size);
    33   _writer.write_unbuffered(data, size);
    34   _processed += size;
    34   ++_elements;
       
    35   _size += size;
    35   return true;
    36   return true;
    36 }
    37 }
    37 
    38 
    38 template <typename T>
    39 template <typename T>
    39 inline bool DefaultDiscarder<T>::discard(T* t, const u1* data, size_t size) {
    40 inline bool DefaultDiscarder<T>::discard(T* t, const u1* data, size_t size) {
    40   _processed += size;
    41   ++_elements;
       
    42   _size += size;
    41   return true;
    43   return true;
    42 }
    44 }
    43 
    45 
    44 template <typename Operation>
    46 template <typename Operation>
    45 inline bool ConcurrentWriteOp<Operation>::process(typename Operation::Type* t) {
    47 inline bool ConcurrentWriteOp<Operation>::process(typename Operation::Type* t) {
    50     return true;
    52     return true;
    51   }
    53   }
    52   const bool result = _operation.write(t, current_top, unflushed_size);
    54   const bool result = _operation.write(t, current_top, unflushed_size);
    53   t->set_concurrent_top(current_top + unflushed_size);
    55   t->set_concurrent_top(current_top + unflushed_size);
    54   return result;
    56   return result;
    55 }
       
    56 
       
    57 template <typename Operation>
       
    58 inline bool ConcurrentWriteOpExcludeRetired<Operation>::process(typename Operation::Type* t) {
       
    59   if (t->retired()) {
       
    60     assert(t->empty(), "invariant");
       
    61     return true;
       
    62   }
       
    63   return ConcurrentWriteOp<Operation>::process(t);
       
    64 }
    57 }
    65 
    58 
    66 template <typename Operation>
    59 template <typename Operation>
    67 inline bool MutexedWriteOp<Operation>::process(typename Operation::Type* t) {
    60 inline bool MutexedWriteOp<Operation>::process(typename Operation::Type* t) {
    68   assert(t != NULL, "invariant");
    61   assert(t != NULL, "invariant");