예제 #1
0
		internal unsafe static void Initialize (ref Runtime.InitializationOptions options)
		{
			if (options.RegistrationData != null) {
				var map = options.RegistrationData->map;
				var lazy_map = Runtime.Registrar.GetRegistrationMap (options.RegistrationData->total_count);
				while (map != null) {
					RegisterMap (map, lazy_map);
					map = map->next;
				}
			}
		}
예제 #2
0
		static unsafe void RegisterMap (Runtime.MTRegistrationMap *registration_map, Dictionary<IntPtr, LazyMapEntry> lazy_map)
		{
			var map = registration_map->map;
			var size = registration_map->map_count;
			var first_custom_type = size - registration_map->custom_type_count;

#if LOG_MAP
			Runtime.NSLog ("RegisterMap () {0} assemblies with {1} types", registration_map->assembly_count, registration_map->map_count);
#endif

			for (int i = 0; i < registration_map->assembly_count; i++) {
				var assembly = Marshal.PtrToStringAuto (Marshal.ReadIntPtr (registration_map->assembly, i * IntPtr.Size));
#if LOG_MAP
				Runtime.NSLog ("    {0}", assembly);
#endif
				Runtime.Registrar.SetAssemblyRegistered (assembly);
			}

			for (int i = 0; i < size; i++) {
				if (map [i].handle == IntPtr.Zero)
					continue; 

				sbyte* ptr = map [i].typename;
				int num = 0;
				while (0 != *ptr++)
					num++;

				var entry = new LazyMapEntry ();
				entry.Typename = new String (map [i].typename, 0, num, System.Text.Encoding.UTF8);
				entry.IsCustomType = i >= first_custom_type;
				lazy_map [map [i].handle] = entry;

#if LOG_MAP
				Runtime.NSLog ("    {0} => 0x{1} IsCustomType: {2}", entry.Typename, map [i].handle.ToString ("x"), entry.IsCustomType);
#endif
			}
		}
예제 #3
0
 internal static void Initialize(ref Runtime.InitializationOptions options)
 {
     tramps = options.Trampolines;
 }