File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ const int MAX_STRING_LENGTH = 8191;
50
50
const u64 MAX_JLONG = 0x7fffffffffffffffULL ;
51
51
const u64 MIN_JLONG = 0x8000000000000000ULL ;
52
52
const int MAX_JFR_EVENT_SIZE = 256 ;
53
- const int JFR_EVENT_FLUSH_THRESHOLD = RECORDING_BUFFER_LIMIT - MAX_JFR_EVENT_SIZE ;
53
+ const int JFR_EVENT_FLUSH_THRESHOLD = RECORDING_BUFFER_LIMIT;
54
54
55
55
56
56
static SpinLock _rec_lock (1 );
@@ -1168,9 +1168,11 @@ class Recording {
1168
1168
buf->putVar64 (type);
1169
1169
buf->putVar64 (constants.size ());
1170
1170
for (std::map<u32, const char *>::const_iterator it = constants.begin (); it != constants.end (); ++it) {
1171
+ int length = strlen (it->second );
1172
+ // 5 is max varint length
1173
+ flushIfNeeded (buf, RECORDING_BUFFER_LIMIT - length - 5 );
1171
1174
buf->putVar64 (it->first | _base_id);
1172
- buf->putUtf8 (it->second );
1173
- flushIfNeeded (buf);
1175
+ buf->putUtf8 (it->second , length);
1174
1176
}
1175
1177
}
1176
1178
You can’t perform that action at this time.
0 commit comments