GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Adaptive: Override setZero(...) / writeZero(...) method to be able to… · netty/netty@5cb7040

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • buffer/src/main/java/io/netty/buffer
    • AdaptivePoolingAllocator.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java‎

Copy file name to clipboardExpand all lines: buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java
+16-1Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ public ByteBuf capacity(int newCapacity) {
10791079
checkNewCapacity(newCapacity);
10801080
if (newCapacity < capacity()) {
10811081
length = newCapacity;
1082-
setIndex0(Math.min(readerIndex(), newCapacity), Math.min(writerIndex(), newCapacity));
1082+
trimIndicesToCapacity(newCapacity);
10831083
return this;
10841084
}
10851085

@@ -1404,6 +1404,21 @@ public int forEachByteDesc(int index, int length, ByteProcessor processor) {
14041404
return forEachResult(ret);
14051405
}
14061406

1407+
@Override
1408+
public ByteBuf setZero(int index, int length) {
1409+
checkIndex(index, length);
1410+
rootParent().setZero(idx(index), length);
1411+
return this;
1412+
}
1413+
1414+
@Override
1415+
public ByteBuf writeZero(int length) {
1416+
ensureWritable(length);
1417+
rootParent().setZero(idx(writerIndex), length);
1418+
writerIndex += length;
1419+
return this;
1420+
}
1421+
14071422
private int forEachResult(int ret) {
14081423
if (ret < adjustment) {
14091424
return -1;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.