< prev index next >

src/hotspot/share/logging/logMessageBuffer.hpp

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #ifndef SHARE_VM_LOGGING_LOGMESSAGEBUFFER_HPP
  25 #define SHARE_VM_LOGGING_LOGMESSAGEBUFFER_HPP
  26 
  27 #include "logging/logDecorations.hpp"
  28 #include "logging/logLevel.hpp"
  29 #include "memory/allocation.hpp"
  30 
  31 class LogMessageBuffer : public StackObj {
  32   friend class LogMessageTest;
  33  protected:
  34   struct LogLine VALUE_OBJ_CLASS_SPEC {
  35     LogLevelType level;
  36     size_t message_offset;
  37   };
  38   static const size_t InitialLineCapacity = 10;
  39   static const size_t InitialMessageBufferCapacity = 1024;
  40 
  41   size_t _message_buffer_size;
  42   size_t _message_buffer_capacity;
  43   char* _message_buffer;
  44 
  45   size_t _line_count;
  46   size_t _line_capacity;
  47   LogLine* _lines;
  48 
  49   bool _allocated;
  50   LogLevelType _least_detailed_level;
  51   size_t (*_prefix_fn)(char*, size_t);
  52 
  53   void initialize_buffers();
  54 




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #ifndef SHARE_VM_LOGGING_LOGMESSAGEBUFFER_HPP
  25 #define SHARE_VM_LOGGING_LOGMESSAGEBUFFER_HPP
  26 
  27 #include "logging/logDecorations.hpp"
  28 #include "logging/logLevel.hpp"
  29 #include "memory/allocation.hpp"
  30 
  31 class LogMessageBuffer : public StackObj {
  32   friend class LogMessageTest;
  33  protected:
  34   struct LogLine {
  35     LogLevelType level;
  36     size_t message_offset;
  37   };
  38   static const size_t InitialLineCapacity = 10;
  39   static const size_t InitialMessageBufferCapacity = 1024;
  40 
  41   size_t _message_buffer_size;
  42   size_t _message_buffer_capacity;
  43   char* _message_buffer;
  44 
  45   size_t _line_count;
  46   size_t _line_capacity;
  47   LogLine* _lines;
  48 
  49   bool _allocated;
  50   LogLevelType _least_detailed_level;
  51   size_t (*_prefix_fn)(char*, size_t);
  52 
  53   void initialize_buffers();
  54 


< prev index next >