Appendix A: System Routines — EStack Utilities
517
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
check_estack_size
Declaration:
void
check_estack_size
(EStackDisplacement
d
)
Category(ies):
EStack Utilities
Description:
This function is used to insure that at least
d
unused Quantums are
available on the estack. For example, all of the push_ . . . procedures
directly or indirectly call
check_estack_size
.
Inputs:
d
— The desired minimum number of unused Quantums on the estack.
Outputs:
None
Assumptions:
None
Side Effects:
Might use
HeapRealloc
to make
d
unused Quantums available on the
estack. Throws an
ESTACK_OVERFLOW_ERROR
if there are less than
d
unused Quantums available on the estack and
HeapRealloc
is unable to
make that amount available.
Availability:
On AMS 1.05 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also:
None
Example:
void push_between (IndexConstQuantum low, IndexConstQuantum high)
/* Pushes quantums indexed from low + 1 through high onto the estack. */
{ Access_AMS_Global_Variables;
OS_CHECK;
check_estack_size ((EStackDisplacement)(high - low));
(void)memcpy (& ESTACK (top_estack + 1u), & ESTACK (low + 1u),
(high - low) * BYTES_PER_QUANTUM);
top_estack += high - low;
}