[wasm-shape] Shuffle code around
This commit is contained in:
parent
9b66e45481
commit
6311b72fcc
|
@ -133,12 +133,6 @@ static hb_wasm_shape_plan_t *
|
||||||
acquire_shape_plan (hb_face_t *face,
|
acquire_shape_plan (hb_face_t *face,
|
||||||
const hb_wasm_face_data_t *face_data)
|
const hb_wasm_face_data_t *face_data)
|
||||||
{
|
{
|
||||||
constexpr uint32_t stack_size = 32 * 1024, heap_size = 2 * 1024 * 1024;
|
|
||||||
|
|
||||||
wasm_module_inst_t module_inst = nullptr;
|
|
||||||
wasm_exec_env_t exec_env = nullptr;
|
|
||||||
wasm_function_inst_t func = nullptr;
|
|
||||||
|
|
||||||
/* Fetch cached one if available. */
|
/* Fetch cached one if available. */
|
||||||
hb_wasm_shape_plan_t *plan = face_data->plan.get_acquire ();
|
hb_wasm_shape_plan_t *plan = face_data->plan.get_acquire ();
|
||||||
if (likely (plan && face_data->plan.cmpexch (plan, nullptr)))
|
if (likely (plan && face_data->plan.cmpexch (plan, nullptr)))
|
||||||
|
@ -146,6 +140,12 @@ acquire_shape_plan (hb_face_t *face,
|
||||||
|
|
||||||
plan = (hb_wasm_shape_plan_t *) hb_calloc (1, sizeof (hb_wasm_shape_plan_t));
|
plan = (hb_wasm_shape_plan_t *) hb_calloc (1, sizeof (hb_wasm_shape_plan_t));
|
||||||
|
|
||||||
|
wasm_module_inst_t module_inst = nullptr;
|
||||||
|
wasm_exec_env_t exec_env = nullptr;
|
||||||
|
wasm_function_inst_t func = nullptr;
|
||||||
|
|
||||||
|
constexpr uint32_t stack_size = 32 * 1024, heap_size = 2 * 1024 * 1024;
|
||||||
|
|
||||||
module_inst = plan->module_inst = wasm_runtime_instantiate(face_data->wasm_module,
|
module_inst = plan->module_inst = wasm_runtime_instantiate(face_data->wasm_module,
|
||||||
stack_size, heap_size,
|
stack_size, heap_size,
|
||||||
nullptr, 0);
|
nullptr, 0);
|
||||||
|
|
Loading…
Reference in New Issue