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

Function CapsulizeBuffer

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

Source from the content-addressed store, hash-verified

231}
232
233Status CapsulizeBuffer(const std::shared_ptr<Buffer>& buffer, PyObject** out) {
234 auto capsule = new BufferCapsule{{buffer}};
235 *out = PyCapsule_New(reinterpret_cast<void*>(capsule), "arrow::Buffer",
236 &BufferCapsule_Destructor);
237 if (*out == nullptr) {
238 delete capsule;
239 RETURN_IF_PYERROR();
240 }
241 return Status::OK();
242}
243
244Status SetNdarrayBase(PyArrayObject* arr, PyObject* base) {
245 if (PyArray_SetBaseObject(arr, base) == -1) {

Callers 1

SetBufferBaseFunction · 0.85

Calls 1

OKFunction · 0.50

Tested by

no test coverage detected