1#ifndef STAN_MATH_REV_CORE_RECOVER_MEMORY_HPP
2#define STAN_MATH_REV_CORE_RECOVER_MEMORY_HPP
20 throw std::logic_error(
21 "empty_nested() must be true"
22 " before calling recover_memory()");
void recover_all()
Recover all the memory used by the stack allocator.
static bool empty_nested()
Return true if there is no nested autodiff being executed.
static void recover_memory()
Recover memory used for all variables for reuse.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
std::vector< ChainableAllocT * > var_alloc_stack_
std::vector< ChainableT * > var_stack_
std::vector< ChainableT * > var_nochain_stack_
static thread_local AutodiffStackStorage * instance_