Skip to content

Commit 2176571

Browse files
authored
Merge pull request numpy#26891 from seberg/issue-26763
DOC: Add a note that one should free the proto struct
2 parents a5a559e + 241a530 commit 2176571

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/source/reference/c-api/array.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,11 @@ User-defined data types
12401240
With these two changes, the code should compile and work on both 1.x
12411241
and 2.x or later.
12421242
1243+
In the unlikely case that you are heap allocating the dtype struct you
1244+
should free it again on NumPy 2, since a copy is made.
1245+
The struct is not a valid Python object, so do not use ``Py_DECREF``
1246+
on it.
1247+
12431248
Register a data-type as a new user-defined data type for
12441249
arrays. The type must have most of its entries filled in. This is
12451250
not always checked and errors can produce segfaults. In

0 commit comments

Comments
 (0)