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

Compact MetadataSystem dicts after assembly load #226

Closed
wants to merge 1 commit into from

Conversation

gluck
Copy link
Contributor

@gluck gluck commented Jun 1, 2015

  • not 100% sure about this one, but my assumption was that:
    "when using the ImmediateModuleReader, the metadata system
    caches should all be empty (all resolved) after load."
    (but I'm not sure that's correct)
  • If that holds true, then this change works, and makes sure that
    the (fairly large) dicts gets compacted (by GC'ing them).

- not 100% sure about this one, but my assumption was that:
"when using the ImmediateModuleReader, the metadata system
 caches should all be empty (all resolved) after load."

- If that holds true, then this change works, and makes sure that
 the (fairly large) dicts gets compacted (by GC'ing them).
if (PInvokes != null) PInvokes.Clear ();
if (GenericParameters != null) GenericParameters.Clear ();
if (GenericConstraints != null) GenericConstraints.Clear ();
if (NestedTypes != null) NestedTypes = new Dictionary<uint, uint[]> ();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case you should pass a zero capacity to the dictionary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's already the default capacity AFAICT, but I can force it if you prefer.

@jbevain
Copy link
Owner

jbevain commented Jul 15, 2016

Fixed in f2097e0. Thanks!

@jbevain jbevain closed this Jul 15, 2016
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.

None yet

2 participants