Skip to content

Commit

Permalink
8317360: Missing null checks in JfrCheckpointManager and JfrStringPoo…
Browse files Browse the repository at this point in the history
…l initialization routines

Reviewed-by: shade, egahlin
  • Loading branch information
Markus Grönlund committed Oct 25, 2023
1 parent 9e98ee6 commit cf4ede0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -109,6 +109,9 @@ bool JfrCheckpointManager::initialize() {
// preallocate buffer count to each of the epoch live lists
for (size_t i = 0; i < global_buffer_prealloc_count * 2; ++i) {
Buffer* const buffer = mspace_allocate(global_buffer_size, _global_mspace);
if (buffer == nullptr) {
return false;
}
_global_mspace->add_to_live_list(buffer, i % 2 == 0);
}
assert(_global_mspace->free_list_is_empty(), "invariant");
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp
Expand Up @@ -131,6 +131,9 @@ bool JfrStringPool::initialize() {
// preallocate buffer count to each of the epoch live lists
for (size_t i = 0; i < string_pool_cache_count * 2; ++i) {
Buffer* const buffer = mspace_allocate(string_pool_buffer_size, _mspace);
if (buffer == nullptr) {
return false;
}
_mspace->add_to_live_list(buffer, i % 2 == 0);
}
assert(_mspace->free_list_is_empty(), "invariant");
Expand Down

1 comment on commit cf4ede0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.