Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/hotspot/share/code/codeBlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size
if (_mutable_data == nullptr) {
vm_exit_out_of_memory(_mutable_data_size, OOM_MALLOC_ERROR, "codebuffer: no space for mutable data");
}
} else {
// We need unique and valid not null address
_mutable_data = blob_end();
}

set_oop_maps(oop_maps);
Expand All @@ -175,12 +178,13 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, int size, uint16_t heade
{
assert(is_aligned(size, oopSize), "unaligned size");
assert(is_aligned(header_size, oopSize), "unaligned size");
_mutable_data = blob_end(); // Valid not null address
}

void CodeBlob::purge() {
if (_mutable_data != nullptr) {
if (_mutable_data != blob_end()) {
os::free(_mutable_data);
_mutable_data = nullptr;
_mutable_data = blob_end(); // Valid not null address
}
if (_oop_maps != nullptr) {
delete _oop_maps;
Expand Down