Open nicklan opened 23 hours ago
Attention: Patch coverage is 97.10145%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 80.73%. Comparing base (
67cc099
) to head (245404c
). Report is 4 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
ffi/src/lib.rs | 96.77% | 0 Missing and 2 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
What changes are proposed in this pull request?
Add more tests to ffi so we're using miri to test more things.
Also, add a testing only
clone_ptr
method to handles. This creates a newHandle
just by cloning the interior pointer value .Functions like
snapshot
want to take an ownedHandle<SharedExternEngine>
, which means we can't "reuse" a handle from rust code. But the semantics are actually that dropping the handle (which will happen after callingsnapshot
) does not drop the underlying data, so if we callsnapshot
from "regular" rust code, we actually leak it. So to "simulate" what happens in c/c++ we canclone_ptr
which just makes another pointer, so you don't have to lose access to the original. This is really not safe, so it's only available in#[cfg(test)]