-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve and cache type-specific functions when targeting the limited API
When targeting the limited API, nanobind cannot directly call type-specific routines like ``tp_init``, ``tp_dealloc``, etc., since the underlying data structures are opaque. A lookup function must be called first to obtain their address. nanobind previously cached their return value using inline static variables, but this led to suboptimal code generation (including several variables protected by a mutex). This commit changes the approach so that the addresses are resolved once when nanobind is first initialized.
- Loading branch information
Showing
4 changed files
with
41 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters