© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
2 replies
lil_big_doot

Is it possible to pin an array using reflection?

I have an interpreter I'm working on and I'd like to support some usage of pointers, but right now all .NET interop is based on reflection or calls to functions I've defined ahead of time. As far as I can tell there's not a way for me to pin an array through a reflection call, but I want to avoid emitting a dynamic method because that won't work on iOS/AOT

Alternatively I was thinking maybe there's a way I can pin the array without using fixed so then the duration of the pin is managed manually by me? Not sure if there's something like GCHandle that can help me out here
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

is it possible to open an image file using c#?
C#CC# / help
2y ago
❔ It it possible to get name of attribute without reflection?
C#CC# / help
3y ago
✅ Getting array values through Reflection
C#CC# / help
3y ago
Regex using an array
C#CC# / help
4y ago