Home / Function/ MsgHdrMemory() — netty Function Reference

MsgHdrMemory() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e22439ae_a268_414c_0783_1a3ef6e6eefe["MsgHdrMemory()"]
  99ae51db_2948_44c9_7279_d8199f61277a["MsgHdrMemory"]
  e22439ae_a268_414c_0783_1a3ef6e6eefe -->|defined in| 99ae51db_2948_44c9_7279_d8199f61277a
  899d881a_ca7c_5bd1_9491_b5d24a2288d3["set()"]
  e22439ae_a268_414c_0783_1a3ef6e6eefe -->|calls| 899d881a_ca7c_5bd1_9491_b5d24a2288d3
  style e22439ae_a268_414c_0783_1a3ef6e6eefe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-io_uring/src/main/java/io/netty/channel/uring/MsgHdrMemory.java lines 50–80

    MsgHdrMemory(short idx, ByteBuffer msgHdrMemoryArray) {
        this.idx = idx;
        this.msgHdrMemoryCleanable = null;
        this.socketAddrMemoryCleanable = null;
        this.iovMemoryCleanable = null;
        this.cmsgDataMemoryCleanable = null;
        int offset = idx * MSG_HDR_SIZE;
        // ByteBuffer.slice(int, int) / duplicate() are specified to produce BIG_ENDIAN byte buffers.
        // Set native order explicitly so native structs written via putInt/putLong use the expected endianness.
        this.msgHdrMemory = PlatformDependent.offsetSlice(
                msgHdrMemoryArray, offset, Native.SIZEOF_MSGHDR
        ).order(ByteOrder.nativeOrder());
        offset += Native.SIZEOF_MSGHDR;
        this.socketAddrMemory = PlatformDependent.offsetSlice(
                msgHdrMemoryArray, offset, Native.SIZEOF_SOCKADDR_STORAGE
        ).order(ByteOrder.nativeOrder());
        offset += Native.SIZEOF_SOCKADDR_STORAGE;
        this.iovMemory = PlatformDependent.offsetSlice(
                msgHdrMemoryArray, offset, Native.SIZEOF_IOVEC
        ).order(ByteOrder.nativeOrder());
        offset += Native.SIZEOF_IOVEC;
        this.cmsgDataMemory = PlatformDependent.offsetSlice(
                msgHdrMemoryArray, offset, Native.CMSG_SPACE
        ).order(ByteOrder.nativeOrder());

        msgHdrMemoryAddress = Buffer.memoryAddress(msgHdrMemory);

        long cmsgDataMemoryAddr = Buffer.memoryAddress(cmsgDataMemory);
        long cmsgDataAddr = Native.cmsghdrData(cmsgDataMemoryAddr);
        cmsgDataOffset = (int) (cmsgDataAddr - cmsgDataMemoryAddr);
    }

Domain

Subdomains

Calls

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free