-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsdesign-proposalThis issue represents a design proposal for a different issue, linked in the descriptionThis issue represents a design proposal for a different issue, linked in the description
Milestone
Description
Summary
Methods in StringUtilities.cs could have implementation without 'unsafe' keyword. It would allow HttpUtilities.GetHeaderName to also become safe as .NET 9 supports passing Span<T> (to generic type parameters).
Motivation and goals
Code becomes somewhat safer, no pointer arithmetic required, no 'pinning' by fixed would be required.
In scope
TryGetAsciiString could use Span<T> instead of char* and byte*, and methods using this could also become safe.
Risks / unknowns
It would still require a fair amount of Unsafe.As<> and Vector256.LoadUnsafe, MemoryMarshal.Cast etc.
The code is perf sensitive, but I believe the safe code would be still on-par with perf.
Other consideration
Could also consider adding Vector512 support on the way.
PaulusParssinen
Metadata
Metadata
Assignees
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsdesign-proposalThis issue represents a design proposal for a different issue, linked in the descriptionThis issue represents a design proposal for a different issue, linked in the description