static public Type methodimpl_attr_type;
static public Type param_array_type;
static public Type void_ptr_type;
+
+ static public Type [] NoTypes;
//
// Internal, not really used outside
// (either because it is the default or the user used the
// -r command line option)
// </remarks>
- ArrayList assemblies;
+ Assembly [] assemblies;
// <remarks>
// Keeps a list of module builders. We used this to do lookups
// on the modulebuilder using GetType -- needed for arrays
// </remarks>
- ArrayList modules;
+ ModuleBuilder [] modules;
// <remarks>
// This is the type_cache from the assemblies to avoid
public TypeManager ()
{
- assemblies = new ArrayList ();
- modules = new ArrayList ();
+ assemblies = null;
+ modules = null;
user_types = new ArrayList ();
types = new Hashtable ();
typecontainers = new Hashtable ();
method_internal_params = new PtrHashtable ();
builder_to_container = new PtrHashtable ();
type_interface_cache = new PtrHashtable ();
+ NoTypes = new Type [0];
}
public void AddUserType (string name, TypeBuilder t)
/// </summary>
public void AddAssembly (Assembly a)
{
- assemblies.Add (a);
+ int top = assemblies != null ? assemblies.Length : 0;
+ Assembly [] n = new Assembly [top + 1];
+
+ if (assemblies != null)
+ assemblies.CopyTo (n, 0);
+ n [top] = a;
+ assemblies = n;
}
/// <summary>
/// </summary>
public void AddModule (ModuleBuilder mb)
{
- modules.Add (mb);
+ int top = modules != null ? modules.Length : 0;
+ ModuleBuilder [] n = new ModuleBuilder [top + 1];
+
+ if (modules != null)
+ modules.CopyTo (n, 0);
+ n [top] = mb;
+ modules = n;
}
/// <summary>
/// </remarks>
static public bool RegisterMethod (MethodBase mb, InternalParameters ip, Type [] args)
{
+ if (args == null)
+ args = NoTypes;
+
method_arguments.Add (mb, args);
method_internal_params.Add (mb, ip);