Page MenuHomePhabricator

copies-rust: introduce PyBytesWithData to reduce GIL requirement
ClosedPublic

Authored by SimonSapin on Jan 6 2021, 9:12 AM.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

SimonSapin created this revision.Jan 6 2021, 9:12 AM
Alphare added inline comments.
rust/hg-cpython/src/copy_tracing.rs
29

Should that be PhantomData<PyBytes>?

SimonSapin added inline comments.Jan 22 2021, 9:05 AM
rust/hg-cpython/src/copy_tracing.rs
29

No. PhantomData<Foo> is purely type-level: it would influence the struct in terms of auto traits etc. without actually having a value of Foo.

Here we do have a value of PyBytes pointing to a specific Python object, and want to eventually call its destructor but not as long as PyBytesWithData::data can still be called.

Alphare accepted this revision.Jan 22 2021, 11:00 AM
baymax updated this revision to Diff 25705.Mon, Feb 22, 9:25 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

baymax updated this revision to Diff 25742.Mon, Feb 22, 11:00 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

baymax updated this revision to Diff 25787.Mon, Feb 22, 3:47 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.