FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[MNT]: Re-enable Automatic Reference Counting (ARC) for macOS backend. · Issue #31797 · matplotlib/matplotlib · GitHub

Repository navigation

[MNT]: Re-enable Automatic Reference Counting (ARC) for macOS backend. #31797

Closed

Description

Summary

@greglucas mentioned that he is interested in moving the macOS backend to ARC. This was previously attempted in #23060, caused a crash in #23653, and reverted in #23654.

After my memory-management PR lands, enabling ARC should be relatively straightforward.

The one issue is that we store Obj-C objects into C structs (allocated by tp_alloc). Support for ARC objects in C structs wasn't added until macOS 10.14 / Xcode 10. We support compiling on macOS 10.12.

Additionally, even if we changed our minimum macOS to 10.14, we would need to ensure that tp_alloc guarantees zero-filled memory to be compatible with the Xcode 10 feature.

In the meantime, we will have to use an __unsafe_unretained attribute on the objects in our C structs, and manually retain/release them.

Proposed fix

No response

Activity

  1. iccir commented on May 31, 2026

    ContributorAuthor

    Adding this comment mostly for my own future reference.

    WWDC 2018 Session 409 explains the "ARC in C Structs" feature added in Xcode 10. Apple likes to remove old WWDC videos, so here's links to the Archived Video (warning, 1.3GB download) and Archived Slides.

  2. added this to the v3.12.0 milestone on Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL