Commit a0e1c8a
Refactor initialize.hpp: de-template compiler to fix 32-bit MSVC C1060
Move the policy-independent dispatch-table-construction algorithm (~1300 lines)
from the doubly-nested template registry<Policies...>::compiler<Options...> into
the non-template detail::generic_compiler, so it compiles once per TU instead of
once per distinct registry type. This fixes the 32-bit MSVC (cl.exe, ~2GB VA space)
C1060 "compiler out of heap space" error when test_compiler.cpp etc. defined
multiple registries.
Key changes:
- Add abstract trace_sink with per-registry trace_sink_impl<Registry> virtual
overrides (5 small virtuals per registry instead of hundreds of operator<<
instantiations).
- Move all algorithm member functions to detail::generic_compiler (now non-
template): build_class_lattice, assign_slots, build_dispatch_tables, etc.
Replace if constexpr(has_trace) with if(tr.on()) and has_option<n2216> with
use_n2216.
- Reduce registry<...>::compiler<> to a thin shim: resolve_classes,
resolve_methods, ctor binding tr.sink to the concrete sink impl, and
install_global_tables running policies then swapping dispatch_data into
registry::state.
- All changes confined to initialize.hpp. Remove test/Jamfile's
<toolset>msvc-14.5,<address-model>32:<build>no skip now that 32-bit works.
- Add trace_demo.cpp example: demonstrates dispatch/next/tracing with
BOOST_OPENMETHOD_TRACE=1.
Verified: MSVC 14.5 x86_64 full suite pass; MSVC 14.5 x86_32 full suite pass
(C1060 gone); gcc 13.4 -Werror clean; trace output identical (byte-for-byte
after address normalization).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 6c68414 commit a0e1c8a
3 files changed
Lines changed: 812 additions & 648 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments