()
| 130 | } |
| 131 | |
| 132 | function initRuntime() { |
| 133 | #if RUNTIME_DEBUG |
| 134 | dbg('initRuntime'); |
| 135 | #endif |
| 136 | #if ASSERTIONS |
| 137 | assert(!runtimeInitialized); |
| 138 | #endif |
| 139 | runtimeInitialized = true; |
| 140 | |
| 141 | #if WASM_WORKERS |
| 142 | if (ENVIRONMENT_IS_WASM_WORKER) return _wasmWorkerInitializeRuntime(); |
| 143 | #endif |
| 144 | |
| 145 | #if PTHREADS |
| 146 | if (ENVIRONMENT_IS_PTHREAD) return startWorker(); |
| 147 | #endif |
| 148 | |
| 149 | #if STACK_OVERFLOW_CHECK >= 2 |
| 150 | setStackLimits(); |
| 151 | #endif |
| 152 | |
| 153 | #if STACK_OVERFLOW_CHECK |
| 154 | checkStackCookie(); |
| 155 | #endif |
| 156 | |
| 157 | #if MAIN_MODULE |
| 158 | callRuntimeCallbacks(__RELOC_FUNCS__); |
| 159 | #endif |
| 160 | |
| 161 | <<< ATINITS >>> |
| 162 | |
| 163 | #if hasExportedSymbol('__wasm_call_ctors') |
| 164 | #if WASM_ESM_INTEGRATION |
| 165 | ___wasm_call_ctors(); |
| 166 | #else |
| 167 | wasmExports['__wasm_call_ctors'](); |
| 168 | #endif |
| 169 | #if RUNTIME_DEBUG |
| 170 | dbg('done __wasm_call_ctors'); |
| 171 | #endif |
| 172 | #endif |
| 173 | |
| 174 | <<< ATPOSTCTORS >>> |
| 175 | #if RUNTIME_DEBUG |
| 176 | dbg('done ATPOSTCTORS'); |
| 177 | #endif |
| 178 | |
| 179 | #if STACK_OVERFLOW_CHECK |
| 180 | checkStackCookie(); |
| 181 | #endif |
| 182 | } |
| 183 | |
| 184 | #if EXIT_RUNTIME |
| 185 |
no test coverage detected