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

AccessTools.CreateInstance improvements #362

Merged
merged 2 commits into from
Nov 16, 2020

Conversation

lbmaian
Copy link
Contributor

@lbmaian lbmaian commented Nov 16, 2020

Look at each commit separately.

First commit:

  • Add AccessTools.CreateInstance<T>()
  • Add unit tests that demonstrate AccessTools.CreateInstance currently only calls public parameterless constructors

Second commit:

  • AccessTools.CreateInstance can now use non-public parameterless constructors
  • Define internal CodeInstruction parameterless constructor
  • AccessTools.CreateInstance also now invokes the ConstructorInfo rather than using Activator.CreateInstance; the former should be faster

…reateInstance only calls public parameterless constructors
…ructors, define internal CodeInstruction parameterless constructor

AccessTools.CreateInstance also now invokes the ConstructorInfo rather than using Activator.CreateInstance; the former should be faster.
@pardeike pardeike merged commit e79874b into pardeike:master Nov 16, 2020
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.

2 participants