提交 06998dcf 编写于 作者: B Brian Johnson

Fixed checktime to loosen execution time limit for debug builds

上级 acca2dfd
......@@ -20,9 +20,15 @@ namespace eos { namespace chain {
std::chrono::time_point<std::chrono::system_clock> checktimeStart;
#ifdef NDEBUG
const int CHECKTIME_LIMIT = 2000;
#else
const int CHECKTIME_LIMIT = 12000;
#endif
DEFINE_INTRINSIC_FUNCTION0(env,checktime,checktime,none) {
auto dur = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - checktimeStart);
if (dur.count() > 1500) {
if (dur.count() > CHECKTIME_LIMIT) {
wlog("checktime called ${d}", ("d", dur.count()));
throw checktime_exceeded();
}
......@@ -295,6 +301,8 @@ DEFINE_INTRINSIC_FUNCTION1(env,loopControl,loopControl,i32,i32,i) {
std::vector<Value> invokeArgs(1);
invokeArgs[0] = U32(bytes);
checktimeStart = std::chrono::system_clock::now();
auto result = Runtime::invokeFunction(alloc_function,invokeArgs);
return &memoryRef<char>( current_memory, result.i32 );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册