src/share/vm/code/codeCache.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/code/codeCache.cpp Mon May 5 14:20:01 2014
--- new/src/share/vm/code/codeCache.cpp Mon May 5 14:20:01 2014
*** 176,189 ****
--- 176,191 ----
// Do not seize the CodeCache lock here--if the caller has not
// already done so, we are going to lose bigtime, since the code
// cache will contain a garbage CodeBlob until the caller can
// run the constructor for the CodeBlob subclass he is busy
// instantiating.
guarantee(size >= 0, "allocation request must be reasonable");
assert_locked_or_safepoint(CodeCache_lock);
+ assert(size > 0, "allocation request must be reasonable");
+ if (size <= 0) {
+ return NULL;
+ }
CodeBlob* cb = NULL;
_number_of_blobs++;
while (true) {
cb = (CodeBlob*)_heap->allocate(size, is_critical);
if (cb != NULL) break;
if (!_heap->expand_by(CodeCacheExpansionSize)) {
// Expansion failed
*** 197,206 ****
--- 199,209 ----
}
}
maxCodeCacheUsed = MAX2(maxCodeCacheUsed, ((address)_heap->high_boundary() -
(address)_heap->low_boundary()) - unallocated_capacity());
print_trace("allocation", cb, size);
+ _number_of_blobs++;
return cb;
}
void CodeCache::free(CodeBlob* cb) {
assert_locked_or_safepoint(CodeCache_lock);
src/share/vm/code/codeCache.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File