Skip to content

Simplify wcwidth_decode_u32_heap() - #280

Closed
Explorer09 wants to merge 1 commit into
jquast:masterfrom
Explorer09:utf8-decode-u32-heap
Closed

Explorer09 wants to merge 1 commit into
jquast:masterfrom
Explorer09:utf8-decode-u32-heap

Conversation

@Explorer09

Copy link
Copy Markdown
Contributor

Make it merely a wrapper function of wcwidth_decode_u32().

Make it merely a wrapper function of wcwidth_decode_u32().

Signed-off-by: Kang-Che Sung <[email protected]>
@codspeed

codspeed Bot commented Sep 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 121 untouched benchmarks


Comparing Explorer09:utf8-decode-u32-heap (b0ba5c9) with master (c6ab635)

Open in CodSpeed

@jquast

jquast commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Thanks, merging with some tests and fixes as #281.

@jquast jquast closed this Sep 30, 2026
jquast added a commit that referenced this pull request Sep 30, 2026
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
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