investigate: STL/heap usage reduction for ETL compatibility (#174) - #177
investigate: STL/heap usage reduction for ETL compatibility (#174)#177vtz wants to merge 2 commits into
Conversation
Audit include/ and src/ for heap-allocating STL (vector, string, unordered_map, smart pointers, function, queue) with data-path vs setup classification, bounded-size notes, and prioritized follow-ups for optional ETL integration. Made-with: Cursor
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 21 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA comprehensive investigative documentation file analyzing STL container usage patterns and heap allocations throughout the codebase, providing an inventory-oriented methodology, categorized findings, and recommendations for potential Embedded Template Library (ETL) optimization. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/investigations/stl-etl-reduction.md`:
- Line 1: Remove the trailing whitespace that the pre-commit hook fixed in the
document titled "# Investigation: Reducing heap / STL usage for ETL
compatibility": open that file, strip any trailing spaces at the ends of lines
(or run the project's pre-commit hooks locally), save the file, and commit the
change so CI no longer fails.
- Line 30: Update the phrasing in the markdown: replace "very large" with
"arbitrarily large" or "unbounded" in the sentence that describes the on-wire
Length field, and change "consumers that" to "consumers who" when referring to
developers/organizations; the sentence also references
TpConfig::max_message_size and max_segment_size (in include/tp/tp_types.h) —
keep those symbols unchanged while applying the wording edits for improved
style.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: dfe1378f-f235-440a-afca-06498866291c
📒 Files selected for processing (1)
docs/investigations/stl-etl-reduction.md
Made-with: Cursor
Summary
Adds
docs/investigations/stl-etl-reduction.md: a quantitative audit of heap-allocating STL usage ininclude/andsrc/(excluding tests/examples) for #174.Key findings (high level)
std::vector<uint8_t>is central to the message / serialization / SD / TP / RPC / events data path (~202 matching lines across 37 files). Bounded ETL replacement needs an explicit max payload policy (MTU-shaped ~1400, single-buffer TCP-ish up to 64 KiB, TP default 1 MiB inTpConfig, UDP datagram cap ~64 KiB; 32-bit length field allows larger logical sizes only if the stack and product allow it).std::unordered_mapappears in 12 files; many maps are already effectively bounded (TP concurrency, session IDs, event IDs). Diagnostic enum→string maps are easy constexpr wins.std::functionis used in public callbacks and in RTOS/ThreadX/Zephyrthread_implvia heap-allocatedstd::function—the platform path is a high-value target foretl::delegateor fn-pointer context.Messagepooling on RTOS does not removevectorpayload heap on POSIX or in the object model itself.SOMEIP_USE_ETL-style) plus type aliases / capacity macros; not a required dependency for multi-platform builds.Deliverable
Full tables, file/line references, categorization (easy / moderate / hard / not recommended), suggested follow-up tickets, and optional-vs-required ETL assessment are in the report.
Made with Cursor
Summary by CodeRabbit