Closed shravanrn closed 1 month ago
Rather than creating a new WASM_RT_USE_SEGUE_FOR_THIS_MODULE
for use in the generated code could we just undefine WASM_RT_USE_SEGUE
when not IS_SINGLE_UNSHARED_MEMORY
is not true?
Rather than creating a new
WASM_RT_USE_SEGUE_FOR_THIS_MODULE
for use in the generated code could we just undefineWASM_RT_USE_SEGUE
when notIS_SINGLE_UNSHARED_MEMORY
is not true?
@sbc100 Sure, that would work too. I think, on balance, I think its a bit more confusing though.
Let me know if you have a strong preference for your approach, and I can make the change. If neutral, I prefer this as it is more explicit about the intent.
Rather than creating a new
WASM_RT_USE_SEGUE_FOR_THIS_MODULE
for use in the generated code could we just undefineWASM_RT_USE_SEGUE
when notIS_SINGLE_UNSHARED_MEMORY
is not true?@sbc100 Sure, that would work too. I think, on balance, I think its a bit more confusing though.
Let me know if you have a strong preference for your approach, and I can make the change. If neutral, I prefer this as it is more explicit about the intent.
Its up to you. This change LGTM as is if you prefer it that way. It makes the diff bigger but I guess that in an of itself is not a strong argument.
The
WASM_RT_USE_SEGUE
macro was previously overloaded for two checks:Check 2 means that
WASM_RT_USE_SEGUE
is only available in the generated C file, and not in the runtime (wasm-rt-impl.c
).However, the runtime needs this information as it must include certain headers only if Segue is supported (Check 1 above), and thus this macro must be available in
wasm-rt.h
. We thus split this macro into two partsWASM_RT_USE_SEGUE
andWASM_RT_USE_SEGUE_FOR_THIS_MODULE
to address the two use cases: "check if Segue is supported" and "check if Segue should be used for the current module"