Skip to content

libtrap: fix container alloc size - #246

Open
dbnk0 wants to merge 1 commit into
masterfrom
fix_trap_init_alloc
Open

dbnk0 wants to merge 1 commit into
masterfrom
fix_trap_init_alloc

Conversation

@dbnk0

@dbnk0 dbnk0 commented Oct 7, 2026

Copy link
Copy Markdown

t_cont_init() multiplies the buffer capacity in bytes by sizeof(char*), allocating eight times the required memory on 64-bit systems.

This patch removes the sizeof multiplier. With the default pool of 50+64+1=115 containers (t_mbuf_init() called from create_tcpip_sender_ifc() or create_tls_sender_ifc()), this reduces requested buffer memory per interface from 92 MB to 11.5 MB.

`t_cont_init()` multiplies the buffer capacity in bytes by
`sizeof(char*)`, allocating eight times the required memory on 64-bit
systems.

This patch removes the `sizeof` multiplier. With the default pool of
50+64+1=115 containers (`t_mbuf_init()` called from
`create_tcpip_sender_ifc()` or `create_tls_sender_ifc()`), this
reduces requested buffer memory per interface from 92 MB to 11.5 MB.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants