8153658: Redundant memory copy in LogStreamNoResourceMark
authorstefank
Mon, 11 Apr 2016 08:51:53 +0200
changeset 37460 bda48699fd11
parent 37459 ff4f09f858b2
child 37461 b5c955296b75
8153658: Redundant memory copy in LogStreamNoResourceMark Reviewed-by: kbarrett, jmasa
hotspot/src/share/vm/logging/logStream.inline.hpp
--- a/hotspot/src/share/vm/logging/logStream.inline.hpp	Mon Apr 11 08:51:53 2016 +0200
+++ b/hotspot/src/share/vm/logging/logStream.inline.hpp	Mon Apr 11 08:51:53 2016 +0200
@@ -33,7 +33,8 @@
 inline void LogStreamNoResourceMark::write(const char* s, size_t len) {
   if (len > 0 && s[len - 1] == '\n') {
     _current_line.write(s, len - 1);
-    _tagset->write(_level, "%s", _current_line.as_string());
+    _current_line.write("\0", 1);
+    _tagset->write(_level, "%s", _current_line.base());
     _current_line.reset();
   } else {
     _current_line.write(s, len);