Skip to content

Commit 09b244a

Browse files
committed
Merge pull request #677 from izaid/master
Updates to match libdynd
2 parents 290a3bb + cd96990 commit 09b244a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

dynd/src/array_from_py.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ dynd::nd::array pydynd::array_from_py(PyObject *obj, uint32_t access_flags, bool
434434
// Python bytes are immutable, so simply use the existing memory with an
435435
// external memory
436436
Py_INCREF(obj);
437-
intrusive_ptr<memory_block_data> bytesref =
438-
make_external_memory_block(reinterpret_cast<void *>(obj), &py_decref_function);
437+
nd::memory_block bytesref =
438+
nd::make_memory_block<nd::external_memory_block>(reinterpret_cast<void *>(obj), &py_decref_function);
439439
char *data_ptr;
440440
result = nd::make_array_memory_block(d, d.extended()->get_arrmeta_size(), d.get_data_size(),
441441
d.get_data_alignment(), &data_ptr);

dynd/src/numpy_interop.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ dynd::nd::array pydynd::array_from_numpy_array(PyArrayObject *obj, uint32_t acce
123123

124124
// Get a shared pointer that tracks buffer ownership
125125
PyObject *base = PyArray_BASE(obj);
126-
dynd::intrusive_ptr<dynd::memory_block_data> memblock;
126+
dynd::nd::memory_block memblock;
127127
if (base == NULL || (PyArray_FLAGS(obj) & NPY_ARRAY_UPDATEIFCOPY) != 0) {
128128
Py_INCREF(obj);
129-
memblock = dynd::make_external_memory_block(obj, py_decref_function);
129+
memblock = dynd::nd::make_memory_block<dynd::nd::external_memory_block>(obj, py_decref_function);
130130
}
131131
else {
132132
if (PyObject_TypeCheck(base, pydynd::get_array_pytypeobject())) {
@@ -136,7 +136,7 @@ dynd::nd::array pydynd::array_from_numpy_array(PyArrayObject *obj, uint32_t acce
136136
}
137137
else {
138138
Py_INCREF(base);
139-
memblock = dynd::make_external_memory_block(base, py_decref_function);
139+
memblock = dynd::nd::make_memory_block<dynd::nd::external_memory_block>(base, py_decref_function);
140140
}
141141
}
142142

0 commit comments

Comments
 (0)