Browse Source

Adjust stack offloading params. Enable only for clang compiler.

cl-refactor
Paweł Bylica 10 years ago
parent
commit
1a6620ef67
  1. 9
      libethereum/ExtVM.cpp

9
libethereum/ExtVM.cpp

@ -37,14 +37,17 @@ static size_t const c_singleExecutionStackSize =
#ifdef NDEBUG #ifdef NDEBUG
12 * 1024; 12 * 1024;
#else #else
64 * 1024; 33 * 1024;
#endif #endif
/// Standard OSX thread stack limit. Should be reasonable for other platforms too. /// Standard OSX thread stack limit. Should be reasonable for other platforms too.
static size_t const c_defaultStackSize = 512 * 1024; static size_t const c_defaultStackSize = 512 * 1024;
/// Stack overhead prior to allocation.
static size_t const c_entryOverhead = 128 * 1024;
/// On what depth execution should be offloaded to additional separated stack space. /// On what depth execution should be offloaded to additional separated stack space.
static unsigned const c_offloadPoint = c_defaultStackSize / c_singleExecutionStackSize; static unsigned const c_offloadPoint = (c_defaultStackSize - c_entryOverhead) / c_singleExecutionStackSize;
void goOnOffloadedStack(Executive& _e, OnOpFunc const& _onOp) void goOnOffloadedStack(Executive& _e, OnOpFunc const& _onOp)
{ {
@ -75,7 +78,7 @@ void go(unsigned _depth, Executive& _e, OnOpFunc const& _onOp)
// Current stack is too small to handle more CALL/CREATE executions. // Current stack is too small to handle more CALL/CREATE executions.
// It needs to be done only once as newly allocated stack space it enough to handle // It needs to be done only once as newly allocated stack space it enough to handle
// the rest of the calls up to the depth limit (c_depthLimit). // the rest of the calls up to the depth limit (c_depthLimit).
#if __GNUC__ #if __clang__ // Enabled for clang only as the problem affects OSX
if (_depth == c_offloadPoint) if (_depth == c_offloadPoint)
goOnOffloadedStack(_e, _onOp); goOnOffloadedStack(_e, _onOp);
else else

Loading…
Cancel
Save