Skip to content

Conversation

Hertzole
Copy link

@Hertzole Hertzole commented Oct 11, 2025

This pull request makes the assembly definition aware of the Unity.Collections package and, if available, enables AsFixedStringXXBytes on both Utf8ValueStringBuilder and Utf16ValueStringBuilder.

There are checks in place to make sure the length of the buffer does not exceed what FixedStringXXBytes supports. They will throw InvalidOperationException if the byte count is exceeded.

This was needed as it helps with the ECS migration in Unity. Unity's Netcode for GameObjects can also benefit from it.

@Hertzole
Copy link
Author

I've also added support for appending FixedStringXXBytes to each string builder. This avoids allocations that would otherwise occur due to calling ToString() on the FixedString type. The append methods use a pointer directly to their buffer.

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