mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8247619: Improve Direct Buffering of Characters
Reviewed-by: alanb, ahgross, rhalade, psandoz
This commit is contained in:
parent
0408b23bcf
commit
a5367cbb7a
3 changed files with 27 additions and 12 deletions
|
@ -292,7 +292,9 @@ class Heap$Type$Buffer$RW$
|
|||
public $Type$Buffer compact() {
|
||||
#if[rw]
|
||||
int pos = position();
|
||||
int rem = limit() - pos;
|
||||
int lim = limit();
|
||||
assert (pos <= lim);
|
||||
int rem = (pos <= lim ? lim - pos : 0);
|
||||
System.arraycopy(hb, ix(pos), hb, ix(0), rem);
|
||||
position(rem);
|
||||
limit(capacity());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue