src/share/vm/utilities/array.hpp
Print this page
rev 6670 : 8049426: Minor cleanups after G1 class unloading
Reviewed-by: stefank
*** 326,335 ****
--- 326,337 ----
}
static size_t byte_sizeof(int length) { return sizeof(Array<T>) + MAX2(length - 1, 0) * sizeof(T); }
// WhiteBox API helper.
+ // Can't distinguish between array of length 0 and length 1,
+ // will always return 0 in those cases.
static int bytes_to_length(size_t bytes) {
assert(is_size_aligned(bytes, BytesPerWord), "Must be, for now");
if (sizeof(Array<T>) >= bytes) {
return 0;