[Mono-devel-list] [PATCH] Cleanup of MonoClass member usage in metadata

Ben Maurer bmaurer at ximian.com
Mon Jan 31 00:28:43 EST 2005


Hey guys,

The attached patch does a cleanup of the usage of the methods, events,
properties, and fields arrays in MonoClass. Right now, we are directly
accessing the members in the in-memory array. This patch makes most
accesses use the enumerator functions that are now part of the public
api.

The patch has a few benefits:

      * The code is cleaner and easier to understand. This is especially
        true in some areas where the old code would loop through all the
        MonoMethod's or MonoField's looking for one with a specific
        name. We now use the helper method in these cases. Even in areas
        where the code can not be replaced with a more general function,
        it is still quite a bit cleaner 
      * It is the first step towards lazy-loading metadata. I have
        already done something similar with MonoMethodHeader and
        MonoMethodSignature, with quite a bit of success. A similar
        thing could easily be done with MonoProperty and MonoEvent.
        MonoClassField and MonoMethod will be much harder, but very
        worthwhile (for monodoc, MonoMethod's are the largest consumer
        of memory from mono, costing us 100's of kb of ram).

— Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: metadata-class-members-cleanup.patch
Type: text/x-patch
Size: 45138 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050131/dd7c14aa/attachment.bin 


More information about the Mono-devel-list mailing list