| 269 | } |
| 270 | |
| 271 | Error CodeHolder::reinit() noexcept { |
| 272 | // Cannot reinitialize if it's not initialized. |
| 273 | if (ASMJIT_UNLIKELY(!is_initialized())) { |
| 274 | return make_error(Error::kNotInitialized); |
| 275 | } |
| 276 | |
| 277 | CodeHolder_reset_sections_and_containers(this, ResetPolicy::kSoft); |
| 278 | |
| 279 | // Create a default section and insert it to the `_sections` array. |
| 280 | (void)CodeHolder_init_section_storage(this); |
| 281 | CodeHolder_add_text_section(this); |
| 282 | |
| 283 | BaseEmitter* emitter = _attached_first; |
| 284 | while (emitter) { |
| 285 | emitter->on_reinit(*this); |
| 286 | emitter = emitter->_attached_next; |
| 287 | } |
| 288 | |
| 289 | return Error::kOk; |
| 290 | } |
| 291 | |
| 292 | void CodeHolder::reset(ResetPolicy reset_policy) noexcept { |
| 293 | if (is_initialized()) { |
no test coverage detected