Skip to content

Commit 2cc3b9a

Browse files
committed
Check Py_LIMITED_API version
1 parent fa30035 commit 2cc3b9a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Include/pymem.h

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ PyAPI_FUNC(void) PyMem_Free(void *ptr);
9191
#define PyMem_DEL(p) PyMem_Free((p))
9292

9393

94+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
9495
// Memory allocator which doesn't require the GIL to be held.
9596
// Usually, it's just a thin wrapper to functions of the standard C library:
9697
// malloc(), calloc(), realloc() and free(). The difference is that
@@ -99,6 +100,7 @@ PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
99100
PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize);
100101
PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
101102
PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
103+
#endif
102104

103105
#ifndef Py_LIMITED_API
104106
# define Py_CPYTHON_PYMEM_H

0 commit comments

Comments
 (0)