numpy  2.0.0
src/multiarray/refcount.c File Reference
#include <Python.h>
#include "structmember.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_config.h"
#include "npy_pycompat.h"

Defines

#define PY_SSIZE_T_CLEAN
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define _MULTIARRAYMODULE

Functions

static void _fillobject (char *optr, PyObject *obj, PyArray_Descr *dtype)
NPY_NO_EXPORT void PyArray_Item_INCREF (char *data, PyArray_Descr *descr)
NPY_NO_EXPORT void PyArray_Item_XDECREF (char *data, PyArray_Descr *descr)
NPY_NO_EXPORT int PyArray_INCREF (PyArrayObject *mp)
NPY_NO_EXPORT int PyArray_XDECREF (PyArrayObject *mp)
NPY_NO_EXPORT void PyArray_FillObjectArray (PyArrayObject *arr, PyObject *obj)

Define Documentation

#define NPY_NO_DEPRECATED_API   NPY_API_VERSION

Function Documentation

static void _fillobject ( char *  optr,
PyObject *  obj,
PyArray_Descr dtype 
) [static]
NPY_NO_EXPORT void PyArray_FillObjectArray ( PyArrayObject arr,
PyObject *  obj 
)
Assumes contiguous
Used for arrays of python objects to increment the reference count of
every python object in the array.
For object arrays, increment all internal references.

<

handles misaligned data too

References PyArrayIterObject_tag::dataptr, PyArray_DESCR, PyArray_Item_INCREF(), and PyArray_ITER_NEXT.

Referenced by PyArray_TakeFrom().

NPY_NO_EXPORT void PyArray_Item_INCREF ( char *  data,
PyArray_Descr descr 
)
Incref all objects found at this record

Referenced by PyArray_INCREF().

NPY_NO_EXPORT void PyArray_Item_XDECREF ( char *  data,
PyArray_Descr descr 
)
XDECREF all objects found at this record
Decrement all internal references for object arrays.
(or arrays with object fields)

<

handles misaligned data too