Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document a behavior of string.Create #10619

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

tannergooding
Copy link
Member

This resolves dotnet/runtime#106903 by documenting the agreed upon behavior:

  • We're good at guaranteeing that the span points to memory that has space for a least one more element than the span
  • We'd guarantee that the span points to zero'd memory, including the null terminator.
  • Our docs would say that if you write to the extra location it must be a null terminator. Writing anything else will result corrupting the string and thus is undefined behavior.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime

Copy link

Learn Build status updates of commit fcc3a28:

✅ Validation status: passed

File Status Preview URL Details
xml/System/String.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

xml/System/String.xml Show resolved Hide resolved
Copy link

Learn Build status updates of commit c811318:

✅ Validation status: passed

File Status Preview URL Details
xml/System/String.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@tannergooding tannergooding merged commit 20b1986 into dotnet:main Oct 30, 2024
4 checks passed
@tannergooding tannergooding deleted the fix-106903 branch October 30, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codify that String.Create can write over the string's null terminator
2 participants