Skip to content

Commit

Permalink
fixup! [FLINK-20663][core] Forbid calling HybridMemorySegment#wrap on…
Browse files Browse the repository at this point in the history
… unsafe segments.
  • Loading branch information
xintongsong committed Feb 14, 2021
1 parent 5cc7dbc commit d1936a8
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -62,6 +62,11 @@ public final class HybridMemorySegment extends MemorySegment {

@Nullable private final Runnable cleaner;

/**
* Wrapping is not allowed when the underlying memory is unsafe. Unsafe memory can be actively
* released, without reference counting. Therefore, access from wrapped buffers, which may not
* be aware of the releasing of memory, could be risky.
*/
private final boolean allowWrap;

/**
Expand Down

0 comments on commit d1936a8

Please sign in to comment.