---
name: "unw_set_cache_size"
section: "3"
platform: "linux"
package: "libunwind"
version: "1.8.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/unw_set_cache_size"
---

# unw\_set\_cache\_size(3)

## NAME

unw\_set\_cache\_size -- set unwind cache size

## SYNOPSIS

\#include \<libunwind.h\>\

int unw\_set\_cache\_size(unw\_addr\_space\_t as, size\_t size, int flag);\

## DESCRIPTION

The unw\_set\_cache\_size() routine sets the cache size of  address space as to hold at least as many items as given by  argument size. It may hold more items as determined by the  implementation. To disable caching, call  unw\_set\_caching\_policy) with a policy of  UNW\_CACHE\_NONE. Flag is currently unused and must be 0.

## RETURN VALUE

On successful completion, unw\_set\_cache\_size() returns 0.  Otherwise the negative value of one of the error-codes below is  returned.

## THREAD AND SIGNAL SAFETY

unw\_set\_cache\_size() is thread-safe but *not* safe  to use from a signal handler.

## ERRORS

- UNW\_ENOMEM

   The desired cache size could not be  established because the application is out of memory.

## SEE ALSO

libunwind(3libunwind), unw\_create\_addr\_space(3libunwind), unw\_set\_caching\_policy(3libunwind), unw\_flush\_cache(3libunwind)

## AUTHOR

Dave Watson\
 Email: **dade.watson@gmail.com**\
 WWW: **http://www.nongnu.org/libunwind/**.
