Skip to content

simplify wcwidth_decode_u32_heap() - #281

Merged
jquast merged 1 commit into
masterfrom
jq/suggested-code-reduction
Sep 30, 2026
Merged

jquast merged 1 commit into
masterfrom
jq/suggested-code-reduction

Conversation

@jquast

@jquast jquast commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Delegate to wcwidth_decode_u32() with no scratch and return its heap buffer, dropping the stack buffer and the copy. Give the empty result a one-element allocation so the returned pointer stays free()-able, and guard the decoder's first memcpy so the no-scratch call is well-defined.

Supersedes #280

Delegate to wcwidth_decode_u32() with no scratch and return its heap
buffer, dropping the stack buffer and the copy.  Give the empty result a
one-element allocation so the returned pointer stays free()-able, and
guard the decoder's first memcpy so the no-scratch call is well-defined.
@codspeed

codspeed Bot commented Sep 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 121 untouched benchmarks


Comparing jq/suggested-code-reduction (6fe6366) with master (c6ab635)

Open in CodSpeed

@jquast
jquast merged commit 5f185b3 into master Sep 30, 2026
35 checks passed
@jquast
jquast deleted the jq/suggested-code-reduction branch September 30, 2026 12:50
@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.60%. Comparing base (c6ab635) to head (6fe6366).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #281      +/-   ##
==========================================
+ Coverage   87.49%   87.60%   +0.11%     
==========================================
  Files          41       41              
  Lines        5614     5609       -5     
  Branches     1501     1500       -1     
==========================================
+ Hits         4912     4914       +2     
+ Misses        324      321       -3     
+ Partials      378      374       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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