Home / Function/ fill() — netty Function Reference

fill() — netty Function Reference

Architecture documentation for the fill() function in IoUringBufferRing.java from the netty codebase.

Function java Buffer Search calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  ac4b63cf_0158_713f_72eb_e14c4589fe54["fill()"]
  0ceb71f6_6540_8338_290b_365306bdbc58["RingConsumer"]
  ac4b63cf_0158_713f_72eb_e14c4589fe54 -->|defined in| 0ceb71f6_6540_8338_290b_365306bdbc58
  d66ab72f_36b1_f061_59f8_5e5807458880["fill()"]
  d66ab72f_36b1_f061_59f8_5e5807458880 -->|calls| ac4b63cf_0158_713f_72eb_e14c4589fe54
  d66ab72f_36b1_f061_59f8_5e5807458880["fill()"]
  ac4b63cf_0158_713f_72eb_e14c4589fe54 -->|calls| d66ab72f_36b1_f061_59f8_5e5807458880
  6957abb8_3a64_9547_a4dc_2a000408aa97["add()"]
  ac4b63cf_0158_713f_72eb_e14c4589fe54 -->|calls| 6957abb8_3a64_9547_a4dc_2a000408aa97
  style ac4b63cf_0158_713f_72eb_e14c4589fe54 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringBufferRing.java lines 87–119

        short fill(short startBid, int numBuffers) {
            // Fetch the tail once before allocate the batch.
            oldTail = (short) SHORT_HANDLE.get(ioUringBufRing, tailFieldPosition);

            // At the moment we always start with bid 0 and so num and bid is the same. As this is more of an
            // implementation detail it is better to still keep both separated.
            this.num = 0;
            this.bid = startBid;
            this.expectedBuffers = numBuffers;
            try {
                if (batchAllocation) {
                    allocator.allocateBatch(this, numBuffers);
                } else {
                    for (int i = 0; i < numBuffers; i++) {
                        add(oldTail, bid++, num++, allocator.allocate());
                    }
                }
            } catch (Throwable t) {
                corrupted = true;
                for (int i = 0; i < buffers.length; i++) {
                    ByteBuf buffer = buffers[i];
                    if (buffer != null) {
                        buffer.release();
                        buffers[i] = null;
                    }
                }
                throw t;
            }
            // Now advanced the tail by the number of buffers that we just added.
            SHORT_HANDLE.setRelease(ioUringBufRing, tailFieldPosition, (short) (oldTail + num));

            return (short) (bid - 1);
        }

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does fill() do?
fill() is a function in the netty codebase, defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringBufferRing.java.
Where is fill() defined?
fill() is defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/IoUringBufferRing.java at line 87.
What does fill() call?
fill() calls 2 function(s): add, fill.
What calls fill()?
fill() is called by 1 function(s): fill.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free