RFR(S): 8029343: CodeCache::allocate increments '_number_of_blobs' even if allocation fails.
tobias.hartmann at oracle.com
Tue May 6 07:27:08 UTC 2014
please review the following patch for bug 8029343.
(1) CodeCache::allocate(...) increments _number_of_blobs before the
actual allocation is performed. In case the allocation fails the counter
is set to a wrong value.
(2) The guarantee(size >= 0, ...) is incorrect. Calling
CodeCache::allocate(...) with size = 0 leads to a segmentation fault.
Further, a guarantee is too strong here. We can simply return NULL at
runtime if the size is <= 0.
(1) The increment is moved after the allocation.
(2) An assert is used instead of the guarantee and NULL is returned if
size <= 0.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev