Skip to content

Add callback table with user args#31

Merged
twallis-cpr merged 6 commits into
mainfrom
feature/CORE-37262-add-bundle-decode-callbacks
May 21, 2026
Merged

Add callback table with user args#31
twallis-cpr merged 6 commits into
mainfrom
feature/CORE-37262-add-bundle-decode-callbacks

Conversation

@twallis-cpr
Copy link
Copy Markdown
Contributor

Part of the larger proton re-architecture here (internal CPR/OTTO employee eyes only 👀 )

This feature branch re-adds the per-bundle decode callbacks from the original protonc library. However, instead of using weak linking. The motive for moving to "strong" linking here is largely to reduce complexity in autogen, and to provide users with the ability to not use a name-dependent function, and to even have a central signal decoding callback.

@twallis-cpr twallis-cpr self-assigned this May 19, 2026
@twallis-cpr twallis-cpr requested a review from a team as a code owner May 19, 2026 18:23
@twallis-cpr twallis-cpr requested review from luis-camero and nnarain-cpr and removed request for a team May 19, 2026 18:23
Comment thread core/src/registry.c
{
for (size_t i = 0; i < registry->bundle_count; i++)
{
if (registry->bundle_id_lut[i].id == bundle_id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Understanding I missed some MRs while on vacation)

How often is this function going to fire? Can the callback be cached in a way that you don't have to do the linear search each time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's kinda what the LUT was for, but yeah the linear search is done each time.

@twallis-cpr twallis-cpr merged commit cc76126 into main May 21, 2026
9 checks passed
@twallis-cpr twallis-cpr deleted the feature/CORE-37262-add-bundle-decode-callbacks branch May 21, 2026 18:02
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.

2 participants