tld_free(9)
π
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 π₯
- Kernel file
./tools/testing/selftests/bpf/prog_tests/task_local_data.h TLD_DEFINE_KEY(9)tld_create_key(9)tld_get_data(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms