Skip to content

Commit

Permalink
Added note about malloc()
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Sep 24, 2023
1 parent 3460592 commit 844a5dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions erfa/ufunc.c.templ
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ static void ufunc_loop_{{ func.pyname }}(
{#- /* if needed, allocate memory for contiguous eraLDBODY copies */ #}
{%- if func.user_dtype == 'dt_eraLDBODY' %}
if (copy_b) {
// Note that we can't use PyArray_malloc here as it is an alias to PyMem_RawMalloc
// which is not available in the Python limited API
_b = malloc(nb * sizeof(eraLDBODY));
if (_b == NULL) {
PyErr_NoMemory();
Expand Down

0 comments on commit 844a5dc

Please sign in to comment.