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

Rewrite SpanHelpers.IndexOfNullByte/IndexOfNullCharacter to unmanaged pointers #81332

Closed
EgorBo opened this issue Jan 29, 2023 · 3 comments
Closed
Assignees
Milestone

Comments

@EgorBo
Copy link
Member

EgorBo commented Jan 29, 2023

  1. It seems to be containing potential GC holes, see Use IndexOf in RsaPaddingProcessor.FillNonZeroBytes #81327 (comment) for potential future uses.
  2. Currently, this function is only used by System.String's ctors accepting unmanaged pointers which then converted to managed ones.

It also will allow to avoid doing verbose Unsafe stuff like

if (uValue == Unsafe.AddByteOffset(ref searchSpace, offset + 1))

and do

if (uValue == searchSpace[offset + 1])

instead.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 29, 2023
@ghost
Copy link

ghost commented Jan 29, 2023

Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.

Issue Details
  1. It seems to be containing potential GC holes, see Use IndexOf in RsaPaddingProcessor.FillNonZeroBytes #81327 (comment) for potential future uses.
  2. Currently, this function is only used by System.String's ctors accepting unmanaged pointers which then converted to managed ones.

It also will allow to avoid doing verbose Unsafe stuff like

if (uValue == Unsafe.AddByteOffset(ref searchSpace, offset + 1))

and do

if (uValue == searchSpace[offset + 1])

instead.

Author: EgorBo
Assignees: -
Labels:

area-System.Runtime, untriaged

Milestone: -

@EgorBo EgorBo added this to the 8.0.0 milestone Jan 30, 2023
@EgorBo EgorBo self-assigned this Jan 30, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jan 30, 2023
@teo-tsirpanis
Copy link
Contributor

Fixed by #81347 (GitHub does not recognize "Addresses").

@ghost ghost locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants