8316669: ImmutableOopMapSet destructor not called

Reviewed-by: thartmann, jvernee, kvn
This commit is contained in:
Thomas Schatzl 2023-09-25 06:38:11 +00:00
parent 837783c2d3
commit 3d6e775d71
3 changed files with 10 additions and 3 deletions

View File

@ -174,8 +174,10 @@ void RuntimeBlob::free(RuntimeBlob* blob) {
}
void CodeBlob::flush() {
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps);
if (_oop_maps != nullptr) {
delete _oop_maps;
_oop_maps = nullptr;
}
NOT_PRODUCT(_asm_remarks.clear());
NOT_PRODUCT(_dbg_strings.clear());
}
@ -190,7 +192,6 @@ void CodeBlob::set_oop_maps(OopMapSet* p) {
}
}
void RuntimeBlob::trace_new_stub(RuntimeBlob* stub, const char* name1, const char* name2) {
// Do not hold the CodeCache lock during name formatting.
assert(!CodeCache_lock->owned_by_self(), "release CodeCache before registering the stub");

View File

@ -871,6 +871,9 @@ ImmutableOopMapSet* ImmutableOopMapSet::build_from(const OopMapSet* oopmap_set)
return builder.build();
}
void ImmutableOopMapSet::operator delete(void* p) {
FREE_C_HEAP_ARRAY(unsigned char, p);
}
//------------------------------DerivedPointerTable---------------------------

View File

@ -335,7 +335,10 @@ private:
address data() const { return (address) this + sizeof(*this) + sizeof(ImmutableOopMapPair) * _count; }
public:
void operator delete(void* p);
ImmutableOopMapSet(const OopMapSet* oopmap_set, int size) : _count(oopmap_set->size()), _size(size) {}
~ImmutableOopMapSet() = default;
ImmutableOopMap* oopmap_at_offset(int offset) const {
assert(offset >= 0 && offset < _size, "must be within boundaries");