On Wed, Dec 9, 2009 at 12:00 PM, Babbage Linden <babb...@lindenlab.com>wrote:

>
> The code I'm using for loading is:
>
> public Script(string class_name, byte[] class_data,
>                       ref long event_handlers)
> {
>             Init();
>             Assembly assembly = Assembly.Load(class_data);
>             foreach (Type NewType in assembly.GetTypes())
>             {
>                 if (NewType.IsSubclassOf(typeof(UserScript)))
>                 {
>                     UserScript userScript =
>                         (UserScript)assembly.CreateInstance(
>                             NewType.ToString());
>
>                     SetUser(userScript, ref event_handlers);
>                     return;
>                 }
>             }
> }
>
>
This loop will consume a lot of resources as the runtime have to decode and
load all types in the assembly before returning it.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to