Cstack_info: Report Information on C Stack Size and Usage

Description Usage Details Value Examples


Report information on the C stack size and usage (if available).




On most platforms, C stack information is recorded when R is initialized and used for stack-checking. If this information is unavailable, the size will be returned as NA, and stack-checking is not performed.

The information on the stack base address is thought to be accurate on Windows, Linux (using glibc), macOS and FreeBSD but a heuristic is used on other platforms. Because this might be slightly inaccurate, the current usage could be estimated as negative. (The heuristic is not used on embedded uses of R on platforms where the stack base information is not thought to be accurate.)

The ‘evaluation depth’ is the number of nested R expressions currently under evaluation: this has a limit controlled by options("expressions").


An integer vector. This has named elements


The size of the stack (in bytes), or NA if unknown.


The estimated current usage (in bytes), possibly NA.


1 (stack grows down, the usual case) or -1 (stack grows up).


The current evaluation depth (including two calls for the call to Cstack_info).



Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.