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

Use ReadOnlySpan to make the alloction free #479

Merged
merged 2 commits into from
Nov 9, 2023
Merged

Use ReadOnlySpan to make the alloction free #479

merged 2 commits into from
Nov 9, 2023

Conversation

Lightczx
Copy link
Contributor

@Lightczx Lightczx commented Nov 9, 2023

Compiler will automatically rewrite const data ref to the bytes in data section of the assembly.
So it's allocation free, zero overhead.

See sample code:
https://sharplab.io/#v2:EYLgZgpghgLgrgJwgZwLQGED2AbbEDGMAlpgHYAyRMECU2yAPgMSly5TB4AEAJkchzwBYAFAABAEwBGUWIDMXDshi1CXSV3RcA3qK76uABwREAbrAjqpANi4AlaDwDypbAE8AyoaikAPMDdqAD4uACEuAF4QgCJqZWi4AA4AblEAXyA=

@Scighost Scighost merged commit b14ae35 into Scighost:main Nov 9, 2023
4 checks passed
@Scighost
Copy link
Owner

Scighost commented Nov 9, 2023

Contributor +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants