Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 18 Oct 2019 12:12:56 +0200] rev 43290
py3: ajust abort message in test-hook.t
Yuya Nishihara <yuya@tcha.org> [Mon, 14 Oct 2019 16:15:19 +0900] rev 43289
rust-cpython: prepare for writing tests that require libpython
What I wanted is to disable the "cpython/extension-module<ver>" feature
while building tests executable, but that seems not doable. Instead,
this patch adds new features dedicated for tests.
The make rule is extracted so that we can easily run cargo tests.
Added a minimal test of ref-sharing as an example. More tests will follow.
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 10:21:34 -0400] rev 43288
rust-cpython: make inner functions and structs of ref_sharing private
Most of these methods were public because they had to be accessible from
macro-generated functions. Some "unsafe" can be removed since we can
guarantee the data consistency across non-public operations.
Yuya Nishihara <yuya@tcha.org> [Sat, 21 Sep 2019 17:05:01 +0900] rev 43287
rust-cpython: keep Python<'a> token in PyRefMut
This just clarifies that the GIL is obtained while PyRefMut is dereferenced,
so there's no need of extra acquire_gil() to drop the reference.
Yuya Nishihara <yuya@tcha.org> [Sat, 21 Sep 2019 17:15:50 +0900] rev 43286
rust-cpython: require GIL to borrow immutable reference from PySharedRefCell
Since the inner value may be leaked, we probably need GIL to guarantee that
there's no data race.
inner(py).borrow() is replaced with inner_shared(py).borrow(), which basically
means any PySharedRefCell data should be accessed through PySharedRef wrapper.
Yuya Nishihara <yuya@tcha.org> [Sun, 15 Sep 2019 22:19:10 +0900] rev 43285
rust-cpython: make PyLeakedRef operations relatively safe
This patch encapsulates the access to the leaked reference to make most
leaked-ref operations safe. The only exception is leaked_ref.map(). I
couldn't figure out how to allow arbitrary map operation safely over an
unsafe static reference. See the docstring and inline comment for details.
Now leak_immutable() can be safely implemented as the PyLeakedRef owns
its inner data.