UNW_SET...HE_SIZE(3libunwind)
π UNW_SET_CACHE_SIZE β bestie edition π
okay so this is a page from the Programming Library manual, third section of libunwind (3libunwind), and today we're learning about unw_set_cache_size. sit down, get comfy, we're doing this π«Ά
β¨ NAME β¨
unw_set_cache_size β set the unwind cache size, that's literally it, that's the whole job π
πΈ SYNOPSIS πΈ
#include <libunwind.h>
int unw_set_cache_size(unw_addr_space_t as, size_t size, int flag);
π¦ DESCRIPTION π¦
so the unw_set_cache_size() routine sets the cache size of the address space as so it can hold at least as many items as the number you pass in size. key word: at least. it might hold more items than you asked for, because that's up to the implementation, not you, bestie π
and if you want to turn caching off entirely? call unw_set_caching_policy) with a policy of UNW_CACHE_NONE. yes, that's the move. no notes. β¨
oh and flag? it's currently unused and must be 0. not "should be", not "preferably", it must be 0. periodt. π
π RETURN VALUE π
when it works, unw_set_cache_size() returns 0. slay. π
when it doesn't work, you get the negative value of one of the error codes listed below. so like, the bad vibes come with a minus sign. π
π₯ THREAD AND SIGNAL SAFETY π₯
unw_set_cache_size() is thread-safe β go off, multi-threaded queens π
but it is not safe to use from a signal handler. do not do that. that's the vibe check it fails. π«
π ERRORS π
UNW_ENOMEMβ the desired cache size could not be established because the application is out of memory. the cache simply said "i can't, i'm full" π
π SEE ALSO π
libunwind(3libunwind)unw_create_addr_space(3libunwind)unw_set_caching_policy(3libunwind)unw_flush_cache(3libunwind)
go read those next, iykyk π§
π AUTHOR π
Dave Watson
- Email:
dade.watson@gmail.com - WWW:
http://www.nongnu.org/libunwind/
and that's the whole page, bestie, no cap, fr fr π this was Programming Library business, dated 29 August 2023, filed under UNW_SET...HE_SIZE(3libunwind) β bye, love u, go set some cache sizes responsibly πβ¨
π¦ where this page comes from
- alpine 3.22: libunwind-doc 1.8.1-r0 Β· MIT
- alpine 3.23: libunwind-doc 1.8.1-r0 Β· MIT
- alpine 3.24: libunwind-doc 1.8.3-r0 Β· MIT
- arch rolling: libunwind 1.8.3-1 Β· MIT
- epel 10: libunwind-devel 1.8.0-4.el10_0 Β· MIT
- epel 9: libunwind-devel 1.8.0-4.el9 Β· MIT
- fedora 43: libunwind-devel 1.8.1-3.fc43 Β· MIT
- fedora 43: libunwind-devel 1.8.1-3.fc43 Β· MIT
- fedora 43: libunwind-devel 1.8.3-4.fc43 Β· MIT
- fedora 43: libunwind-devel 1.8.3-4.fc43 Β· MIT
- fedora 44: libunwind-devel 1.8.3-1.fc44 Β· MIT
- fedora 44: libunwind-devel 1.8.3-1.fc44 Β· MIT
- fedora 44: libunwind-devel 1.8.3-4.fc44 Β· MIT
- fedora 44: libunwind-devel 1.8.3-4.fc44 Β· MIT
- nixpkgs unstable: libunwind 1.8.3-devman
- opensuse-leap 16.0: libunwind-devel 1.8.1-160000.2.2 Β· MIT
- opensuse-leap 16.0: libunwind-devel 1.8.1-160000.2.2 Β· MIT
- opensuse-leap 16.0: libunwind-devel 1.8.1-160000.2.2 Β· MIT
- opensuse-leap 16.0: libunwind-devel 1.8.1-160000.2.2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms