Skip to content

Update memory management docs for free-threaded build #119802

@colesbury

Description

@colesbury

The memory management docs say:

There is no hard requirement to use the memory returned by the allocation functions belonging to a given domain for only the purposes hinted by that domain (although this is the recommended practice). For example, one could use the memory returned by PyMem_RawMalloc() for allocating Python objects or the memory returned by PyObject_Malloc() for allocating memory for buffers.

https://docs.python.org/3/c-api/memory.html#allocator-domains

We should update this to account for the free-threaded build, which requires that the "object" domain only used for allocation Python objects (and that Python objects are only allocated using the "object" domain).

See also: https://peps.python.org/pep-0703/#memory-management

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixes3.14bugs and security fixesdocsDocumentation in the Doc dirtopic-free-threading

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions