Skip to content

chore: mark *Static.c pool helpers static inline#409

Merged
DavidCozens merged 1 commit into
mainfrom
chore/static-helpers-inline
May 20, 2026
Merged

chore: mark *Static.c pool helpers static inline#409
DavidCozens merged 1 commit into
mainfrom
chore/static-helpers-inline

Conversation

@DavidCozens

Copy link
Copy Markdown
Owner

Purpose

Mechanical sweep across every *Static.c file in the tree (23 files, Core + Posix + Windows) to mark the two pool helpers — IndexFromHandle and CleanupAtIndexstatic inline rather than plain static. Both forward declaration and definition pick up the inline keyword in the same line edit.

The rule comes from CLAUDE.md:

Helper functions are forward-declared at the top of the file (after constants/types, before the first definition), usually static inline, and defined immediately beneath the function that first calls them.

CodeRabbit flagged the omission on S11.07's SolidSyslogWinsockResolverStatic.c (PR #408 comment) but the inconsistency had drifted across the whole family — S11.01 / S11.04 / S11.05 / S11.06 / S11.07 — so fixing only S11.07 would leave the family lopsided. One-shot sweep across the lot.

Change Description

Per-file diff is 4 lines (two forward decls + two definitions). 23 files × 4 lines = 92 keyword insertions. No behaviour change.

Both helpers are textbook inline candidates: IndexFromHandle is a 5-line for-loop reverse lookup; CleanupAtIndex is a 3-line bridge that calls the per-class _Cleanup. The compiler will still emit an out-of-line copy of CleanupAtIndex because its address is taken by SolidSyslogPoolAllocator_FreeIfInUse — that's expected and harmless.

Out of scope

The handful of larger *Static.c helpers — BlockStore_ResolveSecurityPolicy, BlockStore_BuildBlockSequenceConfig, MetaSd_IsValidConfig, SwitchingSender_IsValidConfig, UdpSender_IsValidConfig — carry real branching logic and are not inline candidates. Their placement at file end (rather than immediately beneath _Create, their first caller) is a separate placement-rule violation; deferring to a future cleanup so this PR stays narrow.

Verification

  • MSVC msvc-debug (local): full build clean, all 1131 tests pass.
  • Linux build, tidy, IWYU: skipped by judgement — the change is a keyword insertion on a fixed-format pair of identifiers, trusted to CI.

CodeRabbit nit on S11.07 flagged that IndexFromHandle and CleanupAtIndex
in SolidSyslogWinsockResolverStatic.c should be static inline per
CLAUDE.md's helper-placement rule. The rule applies to the whole
*Static.c family and the inconsistency had drifted across S11.01,
S11.04, S11.05, S11.06, and S11.07 (23 files in total).

Mechanical sweep: each affected helper's forward declaration and
definition gain the inline keyword. Both are tiny mechanical helpers
(5- and 3-liners) — natural inline candidates. Placement is unchanged
(they were already defined immediately beneath _Destroy, the first
caller of both).

Out of scope: the handful of larger *Static.c helpers (BlockStore's
ResolveSecurityPolicy / BuildBlockSequenceConfig, the IsValidConfig
trio in MetaSd / SwitchingSender / UdpSender) carry real branching
logic and are not inline candidates. Their placement at file end is
a separate concern.

No behaviour change. MSVC build + full 1131-test suite green locally.
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@DavidCozens has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 58 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 06454580-d1d8-4ac6-9ca5-ab643c418aaf

📥 Commits

Reviewing files that changed from the base of the PR and between a54d8a9 and 74c7b13.

📒 Files selected for processing (24)
  • Core/Source/BlockSequenceStatic.c
  • Core/Source/RecordStoreStatic.c
  • Core/Source/SolidSyslogBlockStoreStatic.c
  • Core/Source/SolidSyslogCircularBufferStatic.c
  • Core/Source/SolidSyslogFileBlockDeviceStatic.c
  • Core/Source/SolidSyslogMetaSdStatic.c
  • Core/Source/SolidSyslogOriginSdStatic.c
  • Core/Source/SolidSyslogPassthroughBufferStatic.c
  • Core/Source/SolidSyslogStreamSenderStatic.c
  • Core/Source/SolidSyslogSwitchingSenderStatic.c
  • Core/Source/SolidSyslogTimeQualitySdStatic.c
  • Core/Source/SolidSyslogUdpSenderStatic.c
  • DEVLOG.md
  • Platform/Posix/Source/SolidSyslogGetAddrInfoResolverStatic.c
  • Platform/Posix/Source/SolidSyslogPosixDatagramStatic.c
  • Platform/Posix/Source/SolidSyslogPosixFileStatic.c
  • Platform/Posix/Source/SolidSyslogPosixMessageQueueBufferStatic.c
  • Platform/Posix/Source/SolidSyslogPosixMutexStatic.c
  • Platform/Posix/Source/SolidSyslogPosixTcpStreamStatic.c
  • Platform/Windows/Source/SolidSyslogWindowsFileStatic.c
  • Platform/Windows/Source/SolidSyslogWindowsMutexStatic.c
  • Platform/Windows/Source/SolidSyslogWinsockDatagramStatic.c
  • Platform/Windows/Source/SolidSyslogWinsockResolverStatic.c
  • Platform/Windows/Source/SolidSyslogWinsockTcpStreamStatic.c
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/static-helpers-inline

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1263 passed, 🙈 2 skipped)
   🚦   build-freertos-host-tdd: 100% successful (✔️ 1383 passed, 🙈 2 skipped)
   🚦   build-linux-clang: 100% successful (✔️ 1215 passed, 🙈 2 skipped)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1215 passed, 🙈 2 skipped)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu: 73% successful (✔️ 36 passed, 🙈 13 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1104 passed, 🙈 1 skipped)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1215 passed, 🙈 2 skipped)
   ⚠️   Clang-Tidy: 3 warnings (normal: 3)
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@DavidCozens DavidCozens merged commit 78c059e into main May 20, 2026
20 checks passed
@DavidCozens DavidCozens deleted the chore/static-helpers-inline branch May 20, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant