MCPcopy Create free account
hub / github.com/apache/arrow / TestOwnedRefNoGILMoves

Function TestOwnedRefNoGILMoves

python/pyarrow/src/arrow/python/python_test.cc:152–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152Status TestOwnedRefNoGILMoves() {
153 PyAcquireGIL lock;
154 lock.release();
155
156 {
157 std::vector<OwnedRef> vec;
158 PyObject *u, *v;
159 {
160 lock.acquire();
161 u = PyList_New(0);
162 v = PyList_New(0);
163 lock.release();
164 }
165 {
166 OwnedRefNoGIL ref(u);
167 vec.push_back(std::move(ref));
168 ASSERT_EQ(ref.obj(), nullptr);
169 }
170 vec.emplace_back(v);
171 ASSERT_EQ(Py_REFCNT(u), 1);
172 ASSERT_EQ(Py_REFCNT(v), 1);
173 return Status::OK();
174 }
175}
176
177std::string FormatPythonException(const std::string& exc_class_name,
178 const std::string& exc_value) {

Callers

nothing calls this directly

Calls 4

push_backMethod · 0.80
emplace_backMethod · 0.80
OKFunction · 0.50
releaseMethod · 0.45

Tested by

no test coverage detected