src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp
branchJEP-349-branch
changeset 57870 00860d9caf4d
parent 54847 59ea39bb2809
--- a/src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp	Fri Aug 23 18:47:55 2019 +0200
+++ b/src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp	Sat Aug 24 14:30:27 2019 +0200
@@ -135,8 +135,7 @@
 bool JfrJavaEventWriter::initialize() {
   static bool initialized = false;
   if (!initialized) {
-    Thread* thread = Thread::current();
-    initialized = setup_event_writer_offsets(thread);
+    initialized = setup_event_writer_offsets(Thread::current());
   }
   return initialized;
 }
@@ -155,6 +154,7 @@
   // large enough to accommodate the "requested size".
   const bool is_valid = buffer->free_size() >= (size_t)(used + requested);
   u1* const new_current_position = is_valid ? buffer->pos() + used : buffer->pos();
+  assert(start_pos_offset != invalid_offset, "invariant");
   w->long_field_put(start_pos_offset, (jlong)buffer->pos());
   w->long_field_put(current_pos_offset, (jlong)new_current_position);
   // only update java writer if underlying memory changed