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 — Auto-port 5.0: AdaptivePoolingAllocator: assign a more explicit value… · netty/netty@20764fa

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
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,14 +1368,11 @@ private static final class BuddyChunk extends Chunk implements IntConsumer {
13681368

13691369
BuddyChunk(AbstractByteBuf delegate, Magazine magazine) {
13701370
super(delegate, magazine, true);
1371-
int capacity = delegate.capacity();
1372-
int capFactor = capacity / MIN_BUDDY_SIZE;
1373-
int tree = (capFactor << 1) - 1;
1374-
int maxShift = Integer.numberOfTrailingZeros(capFactor);
1371+
freeListCapacity = delegate.capacity() / MIN_BUDDY_SIZE;
1372+
int maxShift = Integer.numberOfTrailingZeros(freeListCapacity);
13751373
assert maxShift <= 30; // The top 2 bits are used for marking.
1376-
freeListCapacity = tree >> 1;
13771374
freeList = MpscIntQueue.create(freeListCapacity, -1); // At most half of tree (all leaf nodes) can be freed.
1378-
buddies = new byte[1 + tree];
1375+
buddies = new byte[freeListCapacity << 1];
13791376

13801377
// Generate the buddies entries.
13811378
int index = 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.