mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
GH-131238: Core header refactor (GH-131250)
* Moves most structs in pycore_ header files into pycore_structs.h and pycore_runtime_structs.h * Removes many cross-header dependencies
This commit is contained in:
parent
3ae67ba97e
commit
a1aeec61c4
57 changed files with 1481 additions and 1356 deletions
|
@ -27,34 +27,6 @@ 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 */
|
||||
char api_id;
|
||||
PyMemAllocatorEx alloc;
|
||||
} debug_alloc_api_t;
|
||||
|
||||
struct _pymem_allocators {
|
||||
PyMutex mutex;
|
||||
struct {
|
||||
PyMemAllocatorEx raw;
|
||||
PyMemAllocatorEx mem;
|
||||
PyMemAllocatorEx obj;
|
||||
} standard;
|
||||
struct {
|
||||
debug_alloc_api_t raw;
|
||||
debug_alloc_api_t mem;
|
||||
debug_alloc_api_t obj;
|
||||
} debug;
|
||||
int is_debug_enabled;
|
||||
PyObjectArenaAllocator obj_arena;
|
||||
};
|
||||
|
||||
struct _Py_mem_interp_free_queue {
|
||||
int has_work; // true if the queue is not empty
|
||||
PyMutex mutex; // protects the queue
|
||||
struct llist_node head; // queue of _mem_work_chunk items
|
||||
};
|
||||
|
||||
/* Special bytes broadcast into debug memory blocks at appropriate times.
|
||||
Strings of these are unlikely to be valid addresses, floats, ints or
|
||||
7-bit ASCII.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue