Mon Mar 15 18:28:00 CET 2010 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Mon, 15 Mar 2010 17:57:27 +0000 (17:57 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Mon, 15 Mar 2010 17:57:27 +0000 (17:57 -0000)
commitc9c6fc8b90f1ae0c556759bc14df4971573a680f
treed70fc6ec2f250dd669c8a6bb667287b0827038f4
parent2ba41e2ae61432a469c2a6ea06fef6e0aedd9519
Mon Mar 15 18:28:00 CET 2010 Paolo Molaro <lupus@ximian.com>

* class-internals.h: remove the method header from MonoMethod since
from now on it will be transient. We have a header pointer for method
wrappers, since in that case we need to keep track of it. For this
reason, all the Reflection.Emit generated methods use MonoMethodWrapper
structs now. The same happens with MonoMethodInflated.
* class.c: reset the sre_method flag for inflated method structures:
this makes the code that cares look at the header in the MonoMethodInflated
structure.
* loader.c: lookup the method header in the appropriate field now that
it is removed from MonoMethod.
* metadata-internals.h: add a flag to the method header to know if it
can be freed inside mono_metadata_free_mh ().
* method-builder.c: updates after moving the header field from
MonoMethod to MonoMethodWrapper.
* reflection.c: MonoMethods generated from Reflection.Emit use
MonoMethodWrapper structs if they need a method header now (later take
advantage of this and remove all the current unsafe uses of method_aux_hash).
* metadata.c: make method header parsing not leak when verification
fails. Alloc it with g_malloc() and free it in mono_metadata_free_mh().
These changes save a few hundred KB of runtime memory in a mcs
bootstrap or a monodevelop startup.

svn path=/trunk/mono/; revision=153600
mono/metadata/ChangeLog
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/loader.c
mono/metadata/metadata-internals.h
mono/metadata/metadata.c
mono/metadata/method-builder.c
mono/metadata/reflection.c