equal
deleted
inserted
replaced
150 |
150 |
151 static intx calc_expected(julong small_xss_input) { |
151 static intx calc_expected(julong small_xss_input) { |
152 assert(small_xss_input <= max_julong / 2, "Sanity"); |
152 assert(small_xss_input <= max_julong / 2, "Sanity"); |
153 |
153 |
154 // Match code in arguments.cpp |
154 // Match code in arguments.cpp |
155 julong julong_ret = align_size_up_(small_xss_input, K) / K; |
155 julong julong_ret = align_up_(small_xss_input, K) / K; |
156 assert(julong_ret <= (julong)max_intx, "Overflow: " JULONG_FORMAT, julong_ret); |
156 assert(julong_ret <= (julong)max_intx, "Overflow: " JULONG_FORMAT, julong_ret); |
157 return (intx)julong_ret; |
157 return (intx)julong_ret; |
158 } |
158 } |
159 |
159 |
160 static char buff[100]; |
160 static char buff[100]; |
184 EXPECT_EQ(parse_xss_inner(to_string(1 * M * K + 1), JNI_EINVAL), no_value); |
184 EXPECT_EQ(parse_xss_inner(to_string(1 * M * K + 1), JNI_EINVAL), no_value); |
185 } |
185 } |
186 |
186 |
187 // Test value aligned both to K and vm_page_size. |
187 // Test value aligned both to K and vm_page_size. |
188 { |
188 { |
189 EXPECT_TRUE(is_size_aligned(32 * M, K)); |
189 EXPECT_TRUE(is_aligned(32 * M, K)); |
190 EXPECT_TRUE(is_size_aligned(32 * M, (size_t)os::vm_page_size())); |
190 EXPECT_TRUE(is_aligned(32 * M, (size_t)os::vm_page_size())); |
191 EXPECT_EQ(parse_xss_inner(to_string(32 * M), JNI_OK), (intx)(32 * M / K)); |
191 EXPECT_EQ(parse_xss_inner(to_string(32 * M), JNI_OK), (intx)(32 * M / K)); |
192 } |
192 } |
193 |
193 |
194 // Test around the min limit. |
194 // Test around the min limit. |
195 { |
195 { |