| 1097 | } |
| 1098 | |
| 1099 | bool MAssembly::Load(MonoImage* monoImage) |
| 1100 | { |
| 1101 | if (IsLoaded()) |
| 1102 | return false; |
| 1103 | PROFILE_CPU(); |
| 1104 | #if TRACY_ENABLE |
| 1105 | const StringAnsiView monoImageName(mono_image_get_name(monoImage)); |
| 1106 | ZoneText(*monoImageName, monoImageName.Length()); |
| 1107 | #endif |
| 1108 | |
| 1109 | // Ensure to be unloaded |
| 1110 | Unload(); |
| 1111 | |
| 1112 | // Start |
| 1113 | Stopwatch stopwatch; |
| 1114 | OnLoading(); |
| 1115 | |
| 1116 | // Load |
| 1117 | _monoAssembly = mono_image_get_assembly(monoImage); |
| 1118 | if (_monoAssembly == nullptr) |
| 1119 | { |
| 1120 | OnLoadFailed(); |
| 1121 | return true; |
| 1122 | } |
| 1123 | _monoImage = monoImage; |
| 1124 | _hasCachedClasses = false; |
| 1125 | |
| 1126 | // End |
| 1127 | OnLoaded(stopwatch); |
| 1128 | return false; |
| 1129 | } |
| 1130 | |
| 1131 | bool MAssembly::LoadCorlib() |
| 1132 | { |