RSSAmplifier

Random Thoughts · Feb 24, 2020

Dos and Don'ts of stackalloc

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.

In .NET Core 2.1 a small but well-received feature was the ability to “safely” allocate a segment of data on the stack, using stackalloc , when used with Span<T> . Before Span<T> , stackalloc required being in an unsafe context: unsafe { byte * data = stackalloc byte [ 256 ]; } The use of unsafe , along with the little number of APIs in .NET that could work with pointers, was enough to deter a lot…

Read on vcsjones.dev

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.