From 6311b72fcce18703eff35010bd20c05a748ae3e5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 25 Feb 2023 12:57:57 -0700 Subject: [PATCH] [wasm-shape] Shuffle code around --- src/hb-wasm-shape.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hb-wasm-shape.cc b/src/hb-wasm-shape.cc index 6407244ca..7970e4c5d 100644 --- a/src/hb-wasm-shape.cc +++ b/src/hb-wasm-shape.cc @@ -133,12 +133,6 @@ static hb_wasm_shape_plan_t * acquire_shape_plan (hb_face_t *face, 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. */ hb_wasm_shape_plan_t *plan = face_data->plan.get_acquire (); 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)); + 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, stack_size, heap_size, nullptr, 0);