10000 gh-111924: Fix data races when swapping allocators by colesbury · Pull Request #130287 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111924: Fix data races when swapping allocators #130287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 20, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reorder header
  • Loading branch information
colesbury committed Feb 18, 2025
commit 64bf28cf487c3febec776c998f0a9299880cd1a5
13 changes: 7 additions & 6 deletions Include/internal/pycore_pymem.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ extern int _PyMem_GetAllocatorName(
PYMEM_ALLOCATOR_NOT_SET does nothing. */
extern int _PyMem_SetupAllocators(PyMemAllocatorName allocator);

// Default raw memory allocator that is not affected by PyMem_SetAllocator()
extern void *_PyMem_DefaultRawMalloc(size_t);
extern void *_PyMem_DefaultRawCalloc(size_t, size_t);
extern void *_PyMem_DefaultRawRealloc(void *, size_t);
extern void _PyMem_DefaultRawFree(void *);
extern wchar_t *_PyMem_DefaultRawWcsdup(const wchar_t *str);

/* Is the debug allocator enabled? */
extern int _PyMem_DebugEnabled(void);

Expand All @@ -132,12 +139,6 @@ static inline void _PyObject_XDecRefDelayed(PyObject *obj)
// Periodically process delayed free requests.
extern void _PyMem_ProcessDelayed(PyThreadState *tstate);

extern void * _PyMem_DefaultRawMalloc(size_t);
extern void * _PyMem_DefaultRawCalloc(size_t, size_t);
extern void * _PyMem_DefaultRawRealloc(void *, size_t);
extern void _PyMem_DefaultRawFree(void *);
extern wchar_t * _PyMem_DefaultRawWcsdup(const wchar_t *str);

// Periodically process delayed free requests when the world is stopped.
// Notify of any objects whic should be freeed.
typedef void (*delayed_dealloc_cb)(PyObject *, void *);
Expand Down
Loading
0