Commit 62f66698 authored by John Kirkham's avatar John Kirkham

Define Raw memory functions near non-Raw ones

parent 8d324dfd
from cpython.version cimport PY_VERSION_HEX
cdef extern from *:
void* PyMem_RawMalloc(size_t n) nogil
void* PyMem_RawRealloc(void *p, size_t n) nogil
void PyMem_RawFree(void *p) nogil
cdef extern from "Python.h":
#####################################################################
......@@ -34,6 +29,7 @@ cdef extern from "Python.h":
# available for allocating and releasing memory from the Python
# heap:
void* PyMem_RawMalloc(size_t n) nogil
void* PyMem_Malloc(size_t n)
# Allocates n bytes and returns a pointer of type void* to the
# allocated memory, or NULL if the request fails. Requesting zero
......@@ -41,6 +37,7 @@ cdef extern from "Python.h":
# PyMem_Malloc(1) had been called instead. The memory will not
# have been initialized in any way.
void* PyMem_RawRealloc(void *p, size_t n) nogil
void* PyMem_Realloc(void *p, size_t n)
# Resizes the memory block pointed to by p to n bytes. The
# contents will be unchanged to the minimum of the old and the new
......@@ -50,6 +47,7 @@ cdef extern from "Python.h":
# NULL, it must have been returned by a previous call to
# PyMem_Malloc() or PyMem_Realloc().
void PyMem_RawFree(void *p) nogil
void PyMem_Free(void *p)
# Frees the memory block pointed to by p, which must have been
# returned by a previous call to PyMem_Malloc() or
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment