Home / Function/ allocateBatch() — netty Function Reference

allocateBatch() — netty Function Reference

Architecture documentation for the allocateBatch() function in AbstractIoUringBufferRingAllocator.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e61e35bc_2419_fc59_2447_f13c45617c96["allocateBatch()"]
  4b72e18f_c8bb_55ea_6af6_ff5a52f918ae["AbstractIoUringBufferRingAllocator"]
  e61e35bc_2419_fc59_2447_f13c45617c96 -->|defined in| 4b72e18f_c8bb_55ea_6af6_ff5a52f918ae
  8a1b80ab_8d8f_467f_69b5_0c29207c484b["nextBufferSize()"]
  e61e35bc_2419_fc59_2447_f13c45617c96 -->|calls| 8a1b80ab_8d8f_467f_69b5_0c29207c484b
  style e61e35bc_2419_fc59_2447_f13c45617c96 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringBufferRingAllocator.java lines 44–62

    @Override
    public final void allocateBatch(Consumer<ByteBuf> consumer, int number) {
        if (largeAllocation) {
            int bufferSize = nextBufferSize();
            ByteBuf buffer = allocator.directBuffer(nextBufferSize() * number);
            try {
                for (int i = 0; i < number; i++) {
                    consumer.accept(buffer
                            .retainedSlice(i * bufferSize, bufferSize)
                            .setIndex(0, 0)
                    );
                }
            } finally {
                buffer.release();
            }
        } else {
            IoUringBufferRingAllocator.super.allocateBatch(consumer, number);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does allocateBatch() do?
allocateBatch() is a function in the netty codebase, defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringBufferRingAllocator.java.
Where is allocateBatch() defined?
allocateBatch() is defined in transport-classes-io_uring/src/main/java/io/netty/channel/uring/AbstractIoUringBufferRingAllocator.java at line 44.
What does allocateBatch() call?
allocateBatch() calls 1 function(s): nextBufferSize.

Analyze Your Own Codebase

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

Try Supermodel Free