Skip to content

Commit

Permalink
Use Math.{add,multiply}Exact instead of StrictMath.{add,multiply}Exact
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkamarsik committed Jan 22, 2025
1 parent a0e1a8c commit 84fdfb2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ public static long memGrow(WasmMemory memory, int delta) {
final long previousSize = memoryLib.grow(memory, delta);
if (previousSize == -1) {
throw new WasmJsApiException(WasmJsApiException.Kind.RangeError,
StrictMath.addExact(memoryLib.size(memory), delta) <= memory.declaredMaxSize() ? "Cannot grow memory above implementation limit" : "Cannot grow memory above max limit");
Math.addExact(memoryLib.size(memory), delta) <= memory.declaredMaxSize() ? "Cannot grow memory above implementation limit" : "Cannot grow memory above max limit");
}
return previousSize;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
package org.graalvm.wasm.memory;

import static java.lang.Long.compareUnsigned;
import static java.lang.StrictMath.addExact;
import static java.lang.StrictMath.multiplyExact;
import static java.lang.Math.addExact;
import static java.lang.Math.multiplyExact;
import static org.graalvm.wasm.constants.Sizes.MEMORY_PAGE_SIZE;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
package org.graalvm.wasm.memory;

import static java.lang.Long.compareUnsigned;
import static java.lang.StrictMath.addExact;
import static java.lang.StrictMath.multiplyExact;
import static java.lang.Math.addExact;
import static java.lang.Math.multiplyExact;
import static org.graalvm.wasm.constants.Sizes.MEMORY_PAGE_SIZE;

import java.io.IOException;
Expand Down

0 comments on commit 84fdfb2

Please sign in to comment.