Home / Function/ add() — netty Function Reference

add() — netty Function Reference

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

Function java Buffer Search called by 2

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

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

        private void add(int tail, short bid, int offset, ByteBuf byteBuf) {
            short ringIndex = (short) ((tail + offset) & mask);
            assert buffers[bid] == null;

            long memoryAddress = IoUring.memoryAddress(byteBuf) + byteBuf.writerIndex();
            int writable = byteBuf.writableBytes();

            //  see:
            //  https://github.com/axboe/liburing/
            //      blob/19134a8fffd406b22595a5813a3e319c19630ac9/src/include/liburing.h#L1561
            int position = Native.SIZEOF_IOURING_BUF * ringIndex;
            ioUringBufRing.putLong(position + Native.IOURING_BUFFER_OFFSETOF_ADDR, memoryAddress);
            ioUringBufRing.putInt(position + Native.IOURING_BUFFER_OFFSETOF_LEN, writable);
            ioUringBufRing.putShort(position + Native.IOURING_BUFFER_OFFSETOF_BID, bid);

            buffers[bid] = byteBuf;
        }

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free