Skip to content

Remove /unsafe dependency #12

@monkey0506

Description

@monkey0506

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestrefactorThis requires code to be refactored or improved

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions