-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
ENH: Configurable allocator #17582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Configurable allocator #17582
Changes from 1 commit
55f2f6c
23da73e
94b9f25
81b45fd
fc32c2f
de22327
38274a4
59b520a
5264019
7c396d7
de9001c
9e7c3ed
953cc88
ad9329b
6d10fdb
18bea05
4368023
d243313
c9b6854
a8fd378
a17565b
2ec5912
227c4b8
fb8135d
7291484
c7a9c22
99f8250
b43c1fe
a7a5435
e3723df
144acc6
8539f5f
6ab00d0
e7e8754
5f08532
7266029
5d547ff
4617c50
8f739c4
90205b6
5c0d3f9
3b385d9
e6e12a3
048552d
ad6f8ad
50f8b93
c7438f5
f823ba4
ad13161
0a08acd
1f0301d
3d56aa0
8ea
8000
6818
fb2af4d
f05a1c6
660e0a4
a4f8d71
d7b1a1d
ab1a0eb
b92e36c
76cda3a
3eadf2f
dbe9d73
1bfb870
0511820
23c4bc0
ed8649b
9aacefa
79712fa
a2ae4c0
09b9c0d
efb3c77
2945c64
3a97d9a
1df805c
ef607bd
8bdc9a1
a3256e5
4d6ea65
5941d7c
522c368
442b0e1
8ca8b54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -467,16 +467,30 @@ PyDataMem_SetHandler(PyDataMem_Handler *handler) | |
|
||
/*NUMPY_API | ||
* Return the const char name of the PyDataMem_Handler used by the | ||
* PyArrayObject. If NULL, return the name of the current global policy that | ||
* will be used to allocate data for the next PyArrayObject | ||
* PyArrayObject or its base. If neither the PyArrayObject owns its own data | ||
* nor its base is a PyArrayObject which owns its own data return an empty string. | ||
* If NULL, return the name of the current global policy that | ||
* will be used to allocate data for the next PyArrayObject. | ||
*/ | ||
NPY_NO_EXPORT const char * | ||
PyDataMem_GetHandlerName(PyArrayObject *obj) | ||
{ | ||
if (obj == NULL) { | ||
return current_handler->name; | ||
} | ||
return PyArray_HANDLER(obj)->name; | ||
PyDataMem_Handler *handler; | ||
handler = PyArray_HANDLER(obj); | ||
if (handler != NULL) { | ||
return handler->name; | ||
} | ||
PyObject *base = PyArray_BASE(obj); | ||
if (base != NULL && PyArray_Check(base)) { | ||
handler = PyArray_HANDLER((PyArrayObject *) base); | ||
if (handler != NULL) { | ||
return handler->name; | ||
} | ||
} | ||
return ""; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we then just export There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there is still this scenario that justifies having an
Now I want to know, for debugging purposes, whether handler There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently:
Based on these two facts, why can't we make To summarize the API would look like this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it. Adopted |
||
|
||
NPY_NO_EXPORT PyObject * | ||
|
@@ -494,5 +508,8 @@ get_handler_name(PyObject *NPY_UNUSED(self), PyObject *args) | |
if (name == NULL) { | ||
return NULL; | ||
} | ||
else if (strlen(name) == 0) { | ||
Py_RETURN_NONE; | ||
} | ||
return PyUnicode_FromString(name); | ||
} |
Uh oh!
There was an error while loading. Please reload this page.