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

Function CapsulizeBuffer

python/pyarrow/src/arrow/python/arrow_to_pandas.cc:244–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244Status CapsulizeBuffer(const std::shared_ptr<Buffer>& buffer, PyObject** out) {
245 auto capsule = new BufferCapsule{{buffer}};
246 *out = PyCapsule_New(reinterpret_cast<void*>(capsule), "arrow::Buffer",
247 &BufferCapsule_Destructor);
248 if (*out == nullptr) {
249 delete capsule;
250 RETURN_IF_PYERROR();
251 }
252 return Status::OK();
253}
254
255Status SetNdarrayBase(PyArrayObject* arr, PyObject* base) {
256 if (PyArray_SetBaseObject(arr, base) == -1) {

Callers 1

SetBufferBaseFunction · 0.85

Calls 1

OKFunction · 0.50

Tested by

no test coverage detected