During the review of the Unsafe --> FFM conversion in JavaFX a few preexisting issues around range checking were noted. Specifically:
1. OffHeapArray uses a long for allocating the number of bytes and an int for "used" bytes. Consider whether to change used to be a long. If not, the additional range checking may be needed. Even leaving this aside, we should check both setUsed and incrementUsed to ensure that used <= length.
2. There is this TODO comment in Renderer.java and RendererAA.java:
// suppose _edges.length > _SIZEOF_EDGE_BYTES
// so doubling size is enough to add needed bytes
// note: throw IOOB if neededSize > 2Gb:
As Andy noted, this is unclear - is this a TODO to throw IOOBE or a description of what would happen?
1. OffHeapArray uses a long for allocating the number of bytes and an int for "used" bytes. Consider whether to change used to be a long. If not, the additional range checking may be needed. Even leaving this aside, we should check both setUsed and incrementUsed to ensure that used <= length.
2. There is this TODO comment in Renderer.java and RendererAA.java:
// suppose _edges.length > _SIZEOF_EDGE_BYTES
// so doubling size is enough to add needed bytes
// note: throw IOOB if neededSize > 2Gb:
As Andy noted, this is unclear - is this a TODO to throw IOOBE or a description of what would happen?
- relates to
-
JDK-8334137 Marlin: replace sun.misc.Unsafe memory access methods with FFM
-
- Resolved
-