RSSAmplifier

Random Thoughts · Feb 1, 2019

C# ReadOnlySpan<byte> and static data

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

Since C# 7 there have been a lot of point releases that contain all kinds of goodies. Many of them are performance focused, such as safe stack allocations using Span<T> , or interoperability with improvements to fixed . One that I love, but is not documented well, is some special treatment that ReadOnlySpan<byte> gets when its contents are known at compile time. Here’s an example of a lookup table…

Read on vcsjones.dev

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.