You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-cleanupCategory: PRs that clean code up or issues documenting cleanup.
// The minimum stack size, in bytes, of a Rust stack, excluding red zone
size_t min_sz = sched_loop->min_stack_size;
// Try to reuse an existing stack segment
if (stk != NULL && stk->next != NULL) {
size_t next_sz = user_stack_size(stk->next);
if (min_sz <= next_sz && requested_sz <= next_sz) {
stk = stk->next;
return;
}
}
I think that min_sz <= next_sz is an invariant. We should never be allocating a next_sz that is smaller than min_stack_siz. Change it to an assert (that it preferably disabled when RUST_NBEBUG). This saves a number of instructions and makes accessing the sched_loop unnecessary on the fast path.
The text was updated successfully, but these errors were encountered:
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-cleanupCategory: PRs that clean code up or issues documenting cleanup.
Currently looks like this:
I think that
min_sz <= next_sz
is an invariant. We should never be allocating anext_sz
that is smaller thanmin_stack_siz
. Change it to an assert (that it preferably disabled whenRUST_NBEBUG
). This saves a number of instructions and makes accessing thesched_loop
unnecessary on the fast path.The text was updated successfully, but these errors were encountered: