-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Describe the issue
The interceptors branch currently requires the /unsafe compile switch because it is utilizing unmanaged function pointers. It should be possible to generate source that does not require unsafe code,
Proposed solution
The portions of the generated code that currently rely on unmanaged function pointers should be refactored to remove this dependency. This should allow compilation without unsafe code.
Additional considerations
The use of unmanaged function pointers is intended to keep as close to native code function pointers as possible. Presumably, this would yield better runtime performance, though this hasn't been tested. If there is a performance boost when using unmanaged function pointers, then a compile-time macro like UNSAFE could be checked to create a conditional compilation. This would require the user to have the /unsafe switch and the UNSAFE macro, but currently there's no way for the compiler to check for the /unsafe switch.