mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-106320: Remove private _PyMem API (#107187)
Move private _PyMem functions to the internal C API (pycore_pymem.h): * _PyMem_GetCurrentAllocatorName() * _PyMem_RawStrdup() * _PyMem_RawWcsdup() * _PyMem_Strdup() No longer export these functions. Move pymem_getallocatorsname() function from _testcapi to _testinternalcapi, since the API moved to the internal C API.
This commit is contained in:
parent
d27eb1e406
commit
307186704d
8 changed files with 38 additions and 35 deletions
|
@ -8,8 +8,20 @@ extern "C" {
|
|||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "pymem.h" // PyMemAllocatorName
|
||||
// Try to get the allocators name set by _PyMem_SetupAllocators().
|
||||
// Return NULL if unknown.
|
||||
// Export for shared _testinternalcapi extension.
|
||||
PyAPI_FUNC(const char*) _PyMem_GetCurrentAllocatorName(void);
|
||||
|
||||
// strdup() using PyMem_RawMalloc()
|
||||
extern char* _PyMem_RawStrdup(const char *str);
|
||||
|
||||
// strdup() using PyMem_Malloc().
|
||||
// Export for shared _pickle extension.
|
||||
PyAPI_FUNC(char*) _PyMem_Strdup(const char *str);
|
||||
|
||||
// wcsdup() using PyMem_RawMalloc()
|
||||
extern wchar_t* _PyMem_RawWcsdup(const wchar_t *str);
|
||||
|
||||
typedef struct {
|
||||
/* We tag each block with an API ID in order to tag API violations */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue