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

@ -55,7 +55,9 @@ class InterpreterCodelet: public Stub {
public:
// Initialization/finalization
void initialize(int size,
CodeStrings& strings) { _size = size; DEBUG_ONLY(_strings.assign(strings);) }
CodeStrings& strings) { _size = size;
DEBUG_ONLY(::new(&_strings) CodeStrings();)
DEBUG_ONLY(_strings.assign(strings);) }
void finalize() { ShouldNotCallThis(); }
// General info/converters