Conversation
We must use use_global_gc = false to work properly with the JIT
This reverts commit 9ed07a7.
| return op->mutate_impl(m, std::move(op)); | ||
| // clang-tidy will complain if we just do `op->mutate_impl(m, move(op))` | ||
| // because the order of evaluation between the move and the invocation is | ||
| // undefined; while that's true, we know that op will remain valid throughout |
There was a problem hiding this comment.
I think this might be more than clang-tidy just being fussy, I think it really is sketchy. But the code looks fine.
There was a problem hiding this comment.
I can always go revisit this an implement some other sort of dispatch approach. (Or scrap this mess entirely...) But as a practical matter, it's not clear to me how the compiler could generate misbehaving code here: the unique_ptr needs to keep the pointer alive and valid throughout the life of the call. Since UB makes all things possible, sure, the compiler could legally do anything here, I guess...
There was a problem hiding this comment.
I agree the code as written now (after this PR) is safe.
There was a problem hiding this comment.
Just pushed a revision that should be genuinely safe, PTAL
No description provided.