xintongsong commented on a change in pull request #9747: [FLINK-13985] Use unsafe memory for managed memory URL: https://github.com/apache/flink/pull/9747#discussion_r328413824
########## File path: flink-core/src/test/java/org/apache/flink/core/memory/CrossSegmentTypeTest.java ########## @@ -44,15 +43,15 @@ @Test public void testCompareBytesMixedSegments() { MemorySegment[] segs1 = { - new HeapMemorySegment(new byte[pageSize]), - new HybridMemorySegment(new byte[pageSize]), - new HybridMemorySegment(ByteBuffer.allocateDirect(pageSize)) + MemorySegmentFactory.allocateUnpooledSegment(pageSize), Review comment: We should not replace `new HeapMemorySegment()` with `MemorySegementFactory.allocateUnpooledSegment`. The latter creates a `HybridMemorySegment` instead of `HeapMemorySegment`, while this test case is meant to also validate the behavior of `HeapMemorySegment`. Same for other occurrences in this class and `OperationsOnFreedSegmentTest `. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services