mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8344882: (bf) Temporary direct buffers should not count against the upper limit on direct buffer memory
Reviewed-by: alanb
This commit is contained in:
parent
75f3ec77e4
commit
0312694c46
5 changed files with 38 additions and 11 deletions
|
@ -847,6 +847,11 @@ public abstract sealed class Buffer
|
|||
return new HeapByteBuffer(hb, -1, 0, capacity, capacity, offset, segment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuffer newDirectByteBuffer(long addr, int cap) {
|
||||
return new DirectByteBuffer(addr, cap);
|
||||
}
|
||||
|
||||
@ForceInline
|
||||
@Override
|
||||
public Object getBufferBase(Buffer buffer) {
|
||||
|
|
|
@ -159,9 +159,10 @@ class Direct$Type$Buffer$RW$$BO$
|
|||
}
|
||||
|
||||
// Invoked only by JNI: NewDirectByteBuffer(void*, long)
|
||||
// and JavaNioAccess.newDirectByteBuffer(int).
|
||||
// The long-valued capacity is restricted to int range.
|
||||
//
|
||||
private Direct$Type$Buffer(long addr, long cap) {
|
||||
Direct$Type$Buffer(long addr, long cap) {
|
||||
super(-1, 0, checkCapacity(cap), (int)cap, null);
|
||||
address = addr;
|
||||
cleaner = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue