[feat/precompile-class] feat: move type_caster_base.h non-template definitions to type_caster_base-inl.h - #6134
Open
henryiii wants to merge 2 commits into
Open
Conversation
henryiii
force-pushed
the
feat/precompile-type-caster-base
branch
from
August 7, 2026 03:27
7362e45 to
84a1dee
Compare
…_base-inl.h Moves the free functions (type-info lookup and registration, instance layout, isinstance_generic, cpp_conduit_method, type_info_description), the loader_life_support members (the function-local thread_local stack stays per-module in both modes), and the two heavy type_caster_generic members (the type_info constructor and the main cast overload). Templates, including load_impl<>, stay in the header. Assisted-by: ClaudeCode:claude-fable-5
henryiii
force-pushed
the
feat/precompile-type-caster-base
branch
from
August 7, 2026 03:33
84a1dee to
635a9db
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Description
Stacked on #6133. Third slice of the pre-compilation split: the non-template subset of
detail/type_caster_base.hmoves totype_caster_base-inl.h:all_type_info*,get_type_info,get_local/global_type_info*,get_type_handle,find_registered_python_instance,isinstance_generic,get_object_handle,try_incref,cpp_conduit_method,type_info_description).instance::get_value_and_holder/allocate_layout/deallocate_layout(declared in-class indetail/common.h; only their out-of-line definitions move).loader_life_supportmembers — the function-localstatic thread_localframe stack stays behind the movedtls_current_frame(), so its per-module identity is unchanged in both modes (each extension module links its own copy of the static library).type_caster_genericmembers: thestd::type_infoconstructor and the maincast(const cast_sources &, ...)overload.All templates —
load_impl<>,type_caster<T>machinery, holder helpers — stay in the header. Verified: full test suite passes in both modes; header-only test binary size unchanged.Suggested changelog entry:
📚 Documentation preview 📚: https://pybind11--6134.org.readthedocs.build/