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

Disable reflection option #572

Closed
tgiphil opened this issue Jan 19, 2019 · 3 comments
Closed

Disable reflection option #572

tgiphil opened this issue Jan 19, 2019 · 3 comments
Labels
Milestone

Comments

@tgiphil
Copy link
Member

tgiphil commented Jan 19, 2019

When reflection is disabled, the reflection metadata could be excluded to save memory.

This would be extremely valuable and necessary for low memory platforms.

@tgiphil tgiphil added this to the 2.0 Release milestone Jan 19, 2019
@charsleysa
Copy link
Member

Just a note, this may possible affect the use of generics as some code may possibly need reflection Metadata for some generics to work properly. (AFAIK we still have an incomplete generics implementation).

@charsleysa
Copy link
Member

Related: #331

@tgiphil
Copy link
Member Author

tgiphil commented Jan 19, 2019

  1. Added compiler option (--disable-reflection) to indicate if reflection will be supported.

  2. Update MetadataStage.cs so that only data structures required functionality to support RTTI are emitted.

  3. Items not emit:

  • Names
  • Properties
  • Fields
  • Parameters
  • Custom Attributes
  • Assemblies
  1. Reorder Method definition fields so that RTTI information is first. That way the method definition entry can be truncated when reflection support is not enabled.

  2. Exclude methods that enable reflection. (Note: The method scanner may excluded some of this).

  3. Add flag to indicate to the runtime that reflection is disabled (and metadata may be missing)

@tgiphil tgiphil changed the title Add option to exclude reflection support Add option to disable reflection Jan 19, 2019
@tgiphil tgiphil changed the title Add option to disable reflection Disable reflection option Jan 19, 2019
@tgiphil tgiphil modified the milestones: 2.0 Release, Future Jan 4, 2020
@tgiphil tgiphil closed this as completed Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants