@@ -34,22 +34,22 @@ public static Type FormatterType
3434 internal static void Stash ( )
3535 {
3636 var metaStorage = new RuntimeDataStorage ( ) ;
37- MetaType . StashPush ( metaStorage ) ;
37+ MetaType . SaveRuntimeData ( metaStorage ) ;
3838
3939 var importStorage = new RuntimeDataStorage ( ) ;
40- ImportHook . StashPush ( importStorage ) ;
40+ ImportHook . SaveRuntimeData ( importStorage ) ;
4141
4242 var typeStorage = new RuntimeDataStorage ( ) ;
43- TypeManager . StashPush ( typeStorage ) ;
43+ TypeManager . SaveRuntimeData ( typeStorage ) ;
4444
4545 var clsStorage = new RuntimeDataStorage ( ) ;
46- ClassManager . StashPush ( clsStorage ) ;
46+ ClassManager . SaveRuntimeData ( clsStorage ) ;
4747
4848 var moduleStorage = new RuntimeDataStorage ( ) ;
49- StashPushModules ( moduleStorage ) ;
49+ SaveRuntimeDataModules ( moduleStorage ) ;
5050
5151 var objStorage = new RuntimeDataStorage ( ) ;
52- StashPushObjects ( objStorage ) ;
52+ SaveRuntimeDataObjects ( objStorage ) ;
5353
5454 var runtimeStorage = new RuntimeDataStorage ( ) ;
5555 runtimeStorage . AddValue ( "meta" , metaStorage ) ;
@@ -82,19 +82,19 @@ internal static void Stash()
8282 XDecref ( capsule ) ;
8383 }
8484
85- internal static void StashPop ( )
85+ internal static void RestoreRuntimeData ( )
8686 {
8787 try
8888 {
89- StashPopImpl ( ) ;
89+ RestoreRuntimeDataImpl ( ) ;
9090 }
9191 finally
9292 {
9393 ClearStash ( ) ;
9494 }
9595 }
9696
97- private static void StashPopImpl ( )
97+ private static void RestoreRuntimeDataImpl ( )
9898 {
9999 IntPtr capsule = PySys_GetObject ( "clr_data" ) ;
100100 if ( capsule == IntPtr . Zero )
@@ -109,12 +109,12 @@ private static void StashPopImpl()
109109 var formatter = CreateFormatter ( ) ;
110110 var storage = ( RuntimeDataStorage ) formatter . Deserialize ( ms ) ;
111111
112- var objs = StashPopObjects ( storage . GetStorage ( "objs" ) ) ;
113- StashPopModules ( storage . GetStorage ( "modules" ) ) ;
114- var clsObjs = ClassManager . StashPop ( storage . GetStorage ( "classes" ) ) ;
115- TypeManager . StashPop ( storage . GetStorage ( "types" ) ) ;
116- ImportHook . StashPop ( storage . GetStorage ( "import" ) ) ;
117- PyCLRMetaType = MetaType . StashPop ( storage . GetStorage ( "meta" ) ) ;
112+ var objs = RestoreRuntimeDataObjects ( storage . GetStorage ( "objs" ) ) ;
113+ RestoreRuntimeDataModules ( storage . GetStorage ( "modules" ) ) ;
114+ var clsObjs = ClassManager . RestoreRuntimeData ( storage . GetStorage ( "classes" ) ) ;
115+ TypeManager . RestoreRuntimeData ( storage . GetStorage ( "types" ) ) ;
116+ ImportHook . RestoreRuntimeData ( storage . GetStorage ( "import" ) ) ;
117+ PyCLRMetaType = MetaType . RestoreRuntimeData ( storage . GetStorage ( "meta" ) ) ;
118118
119119 foreach ( var item in objs )
120120 {
@@ -137,7 +137,7 @@ public static void ClearStash()
137137 PySys_SetObject ( "clr_data" , IntPtr . Zero ) ;
138138 }
139139
140- private static void StashPushObjects ( RuntimeDataStorage storage )
140+ private static void SaveRuntimeDataObjects ( RuntimeDataStorage storage )
141141 {
142142 var objs = ManagedType . GetManagedObjects ( ) ;
143143 var extensionObjs = new List < ManagedType > ( ) ;
@@ -215,7 +215,7 @@ private static void StashPushObjects(RuntimeDataStorage storage)
215215 storage . AddValue ( "contexts" , contexts ) ;
216216 }
217217
218- private static Dictionary < ManagedType , InterDomainContext > StashPopObjects ( RuntimeDataStorage storage )
218+ private static Dictionary < ManagedType , InterDomainContext > RestoreRuntimeDataObjects ( RuntimeDataStorage storage )
219219 {
220220 var extensions = storage . GetValue < List < ManagedType > > ( "extensions" ) ;
221221 var internalStores = storage . GetValue < List < CLRObject > > ( "internalStores" ) ;
@@ -245,7 +245,7 @@ private static Dictionary<ManagedType, InterDomainContext> StashPopObjects(Runti
245245 return storedObjs ;
246246 }
247247
248- private static void StashPushModules ( RuntimeDataStorage storage )
248+ private static void SaveRuntimeDataModules ( RuntimeDataStorage storage )
249249 {
250250 var pyModules = PyImport_GetModuleDict ( ) ;
251251 var itemsRef = PyDict_Items ( pyModules ) ;
@@ -268,7 +268,7 @@ private static void StashPushModules(RuntimeDataStorage storage)
268268 storage . AddValue ( "modules" , modules ) ;
269269 }
270270
271- private static void StashPopModules ( RuntimeDataStorage storage )
271+ private static void RestoreRuntimeDataModules ( RuntimeDataStorage storage )
272272 {
273273 var modules = storage . GetValue < Dictionary < IntPtr , IntPtr > > ( "modules" ) ;
274274 var pyMoudles = PyImport_GetModuleDict ( ) ;
0 commit comments