8054292: code comments leak in fastdebug builds

Added deallocation to destructor; hardened interface against misuse

Reviewed-by: kvn
This commit is contained in:
David Chase 2014-08-29 19:45:49 -04:00
parent 3eb44b3955
commit 4c9f643e10
5 changed files with 81 additions and 11 deletions

View file

@ -238,6 +238,7 @@ void* BufferBlob::operator new(size_t s, unsigned size, bool is_critical) throw(
void BufferBlob::free( BufferBlob *blob ) {
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
blob->flush();
{
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
CodeCache::free((CodeBlob*)blob);