Skip to content

C: Make hb_buffer_append_char thread-safe#793

Merged
marcoroth merged 1 commit into
mainfrom
c-thread-safe
Nov 6, 2025
Merged

C: Make hb_buffer_append_char thread-safe#793
marcoroth merged 1 commit into
mainfrom
c-thread-safe

Conversation

@marcoroth

@marcoroth marcoroth commented Nov 6, 2025

Copy link
Copy Markdown
Owner

This pull request replaces the static temporary buffer in hb_buffer_append_char with a stack-allocated buffer so parallel calls no longer share mutable state and could corrupt appended output.

Before, it corrupted data like this on rare occasions:

  left: "<piv>\n                            \n    <p>                </p>\n           \n</div>"
 right: "<div>\n                            \n    <p>                </p>\n           \n</div>"

This was only noticeable in the Cargo tests, since they run so fast in parallel and quick succession that it could happen occasionally.

@github-actions github-actions Bot added the c label Nov 6, 2025
@marcoroth marcoroth merged commit 67ff098 into main Nov 6, 2025
24 checks passed
@marcoroth marcoroth deleted the c-thread-safe branch November 6, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant