Skip to content

feat: embed compile time known arrays#107

Open
unsafePtr wants to merge 1 commit intoCysharp:masterfrom
unsafePtr:feat/embed-compiletime-known-arrays
Open

feat: embed compile time known arrays#107
unsafePtr wants to merge 1 commit intoCysharp:masterfrom
unsafePtr:feat/embed-compiletime-known-arrays

Conversation

@unsafePtr
Copy link
Copy Markdown

@unsafePtr unsafePtr commented Dec 8, 2025

Instead of calling ToCharArray/UTF8.GetBytes we can embed arrays at the compile time into assembly.

Don't be mislead by getter. ReadOnly<x> name => is a known way to embed information at compile time.

Here is an example of how it looks like
https://sharplab.io/#gist:be78d99350441c76fc10efad8b76ea07

Compile-time known boundaries = possibility to remove boundaries when accessing array or constant-fold when. At worst it will improve initialization times.

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.

1 participant