提交 9bfdcc6f 编写于 作者: M Matt Witherspoon

Explict static_asserts on some constraint variables

上级 90841706
......@@ -7,11 +7,17 @@ namespace IR {
namespace eosio { namespace chain {
namespace wasm_constraints {
//Be aware that some of these are required to be a multiple of some internal number
constexpr unsigned maximum_linear_memory = 1024*1024; //bytes
constexpr unsigned maximum_mutable_globals = 1024; //bytes
constexpr unsigned maximum_table_elements = 1024; //elements
constexpr unsigned maximum_linear_memory_init = 64*1024; //bytes
static constexpr unsigned wasm_page_size = 64*1024;
static_assert(maximum_linear_memory%wasm_page_size == 0, "maximum_linear_memory must be mulitple of wasm page size");
static_assert(maximum_mutable_globals%4 == 0, "maximum_mutable_globals must be mulitple of 4");
static_assert(maximum_table_elements*8%4096 == 0, "maximum_table_elements*8 must be mulitple of 4096");
static_assert(maximum_linear_memory_init%wasm_page_size == 0, "maximum_linear_memory_init must be mulitple of wasm page size");
}
//Throws if something in the module violates
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册