File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
test/hotspot/jtreg/vmTestbase/nsk/share/gc Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2005, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2005, 2024 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -150,12 +150,9 @@ public static int getReferenceObjectSize() {
150
150
* @return length of array
151
151
*/
152
152
public static int getArrayLength (long memory , long objectSize ) {
153
- int referenceSize = getReferenceSize ();
154
153
int arrayExtraSize = getArrayExtraSize ();
155
- return (int ) Math .min (
156
- (memory - arrayExtraSize ) / (objectSize + referenceSize ),
157
- Integer .MAX_VALUE
158
- );
154
+ return (int ) Math .min ((memory - arrayExtraSize ) / objectSize ,
155
+ Integer .MAX_VALUE );
159
156
}
160
157
161
158
/**
@@ -166,7 +163,7 @@ public static int getArrayLength(long memory, long objectSize) {
166
163
* @return size of array
167
164
*/
168
165
public static long getArraySize (int length , long objectSize ) {
169
- return getObjectExtraSize () + length * ( objectSize + getReferenceSize ()) ;
166
+ return getArrayExtraSize () + length * objectSize ;
170
167
}
171
168
172
169
/**
You can’t perform that action at this time.
0 commit comments