Determines whether sufficient space exists on the current thread's stack to allocate the requested number of bytes of local storage.
cma_stack_check_limit_np( size);
Argument Data Type Accesssize opaque cma_t_integer read
#includecma_t_boolean cma_stack_check_limit_np ( cma_t_integer size);
A DECthreads stack consists of the following three parts:
If the thread does not use the cma_stack_check_limit_np routine, it is possible for a thread to skip over the guard zone of its stack by, for example, allocating a very large array on the stack. If the thread writes to the part of the array that extends beyond its own guard zone before attempting to access the part of the array in its own guard zone, it would corrupt the memory allocated at that location; for example, another thread's stack. This results in unpredictable behavior of the application and is difficult to debug. The cma_stack_check_limit_np routine recognizes that situation and returns cma_c_false.
When cma_stack_check_limit_np is called from the thread that is running on the default process stack, cma_stack_check_limit_np attempts to access each page that would fall within the requested allocation. It returns cma_c_true unless the system is unable to expand the process stack to the needed size.
cma_c_true Space can be allocated. cma_c_false Space cannot be allocated.