tld_free(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tld_free(9) β€” like, the Kernel API Manual page for tld_free ✨

okay bestie, pull up a chair, because this one is short but it matters 🫢


🌸 NAME 🌸

tld_free β€” frees the task local data memory of the thread that's calling it, no cap πŸ’–


✨ SYNOPSIS ✨

void tld_free (void );

that's it. that's the whole signature. she's simple, she's iconic πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • void β€” literally no arguments. nothing. zero. the void is voiding πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

so for the calling thread, every pointer to TLDs that you acquired before this call? yeah, after tld_free they all become invalid. gone. not your problem anymore πŸ’€

like, users must call tld_free on thread exit to prevent a memory leak β€” that's not a suggestion, that's the vibe check you have to pass ⭐

alternatively, you can define TLD_FREE_DATA_ON_THREAD_EXIT and a thread exit handler gets registered to free the memory automatically for you. set it and forget it, main character energy fr fr πŸ’…

⚠️ and now the warning, because we care: calling tld_free before thread exit is undefined behavior, which may lead to a null-pointer dereference. so like… don't 😭 that's the dangerous one. undefined behavior is not a cute look, bestie 🚨

πŸ”₯ SEE ALSO πŸ”₯

all the siblings, go read them too πŸ§šπŸ’œ


and that's the page!! mwah πŸ’‹ this one comes from ./tools/testing/selftests/bpf/... and it's dated October 2026 β€” so yeah, she's from the future, we stan a time-traveling manpage πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from