Commit 12b0bb6f authored by Simon Marlow's avatar Simon Marlow

Account for stack allocation in the thread's allocation counter

Summary: (see comment for details)

Test Plan: validate

Reviewers: bgamari, ezyang, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1243
parent c8d438fb
......@@ -602,7 +602,15 @@ threadStackOverflow (Capability *cap, StgTSO *tso)
"allocating new stack chunk of size %d bytes",
chunk_size * sizeof(W_));
// Charge the current thread for allocating stack. Stack usage is
// non-deterministic, because the chunk boundaries might vary from
// run to run, but accounting for this is better than not
// accounting for it, since a deep recursion will otherwise not be
// subject to allocation limits.
cap->r.rCurrentTSO = tso;
new_stack = (StgStack*) allocate(cap, chunk_size);
cap->r.rCurrentTSO = NULL;
SET_HDR(new_stack, &stg_STACK_info, old_stack->header.prof.ccs);
TICK_ALLOC_STACK(chunk_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment