| 44 | } |
| 45 | |
| 46 | static void deinit_ops(struct hc_vm *vm) { |
| 47 | uint8_t *p = vm->code.start; |
| 48 | |
| 49 | hc_vector_do(&vm->ops, _op) { |
| 50 | const struct hc_op *op = *(const struct hc_op **)_op; |
| 51 | p += sizeof(hc_op_eval_t); |
| 52 | |
| 53 | if (op->deinit) { |
| 54 | op->deinit(hc_align(p, op->align)); |
| 55 | } |
| 56 | |
| 57 | p += op_items(op, p, vm) * vm->code.item_size; |
| 58 | } |
| 59 | |
| 60 | hc_vector_deinit(&vm->ops); |
| 61 | } |
| 62 | |
| 63 | void hc_vm_deinit(struct hc_vm *vm) { |
| 64 | deinit_stack(vm); |
no test coverage detected