@@ -34,22 +34,22 @@ public static Type FormatterType
34
34
internal static void Stash ( )
35
35
{
36
36
var metaStorage = new RuntimeDataStorage ( ) ;
37
- MetaType . StashPush ( metaStorage ) ;
37
+ MetaType . SaveRuntimeData ( metaStorage ) ;
38
38
39
39
var importStorage = new RuntimeDataStorage ( ) ;
40
- ImportHook . StashPush ( importStorage ) ;
40
+ ImportHook . SaveRuntimeData ( importStorage ) ;
41
41
42
42
var typeStorage = new RuntimeDataStorage ( ) ;
43
- TypeManager . StashPush ( typeStorage ) ;
43
+ TypeManager . SaveRuntimeData ( typeStorage ) ;
44
44
45
45
var clsStorage = new RuntimeDataStorage ( ) ;
46
- ClassManager . StashPush ( clsStorage ) ;
46
+ ClassManager . SaveRuntimeData ( clsStorage ) ;
47
47
48
48
var moduleStorage = new RuntimeDataStorage ( ) ;
49
- StashPushModules ( moduleStorage ) ;
49
+ SaveRuntimeDataModules ( moduleStorage ) ;
50
50
51
51
var objStorage = new RuntimeDataStorage ( ) ;
52
- StashPushObjects ( objStorage ) ;
52
+ SaveRuntimeDataObjects ( objStorage ) ;
53
53
54
54
var runtimeStorage = new RuntimeDataStorage ( ) ;
55
55
runtimeStorage . AddValue ( "meta" , metaStorage ) ;
@@ -82,19 +82,19 @@ internal static void Stash()
82
82
XDecref ( capsule ) ;
83
83
}
84
84
85
- internal static void StashPop ( )
85
+ internal static void RestoreRuntimeData ( )
86
86
{
87
87
try
88
88
{
89
- StashPopImpl ( ) ;
89
+ RestoreRuntimeDataImpl ( ) ;
90
90
}
91
91
finally
92
92
{
93
93
ClearStash ( ) ;
94
94
}
95
95
}
96
96
97
- private static void StashPopImpl ( )
97
+ private static void RestoreRuntimeDataImpl ( )
98
98
{
99
99
IntPtr capsule = PySys_GetObject ( "clr_data" ) ;
100
100
if ( capsule == IntPtr . Zero )
@@ -109,12 +109,12 @@ private static void StashPopImpl()
109
109
var formatter = CreateFormatter ( ) ;
110
110
var storage = ( RuntimeDataStorage ) formatter . Deserialize ( ms ) ;
111
111
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" ) ) ;
118
118
119
119
foreach ( var item in objs )
120
120
{
@@ -137,7 +137,7 @@ public static void ClearStash()
137
137
PySys_SetObject ( "clr_data" , IntPtr . Zero ) ;
138
138
}
139
139
140
- private static void StashPushObjects ( RuntimeDataStorage storage )
140
+ private static void SaveRuntimeDataObjects ( RuntimeDataStorage storage )
141
141
{
142
142
var objs = ManagedType . GetManagedObjects ( ) ;
143
143
var extensionObjs = new List < ManagedType > ( ) ;
@@ -215,7 +215,7 @@ private static void StashPushObjects(RuntimeDataStorage storage)
215
215
storage . AddValue ( "contexts" , contexts ) ;
216
216
}
217
217
218
- private static Dictionary < ManagedType , InterDomainContext > StashPopObjects ( RuntimeDataStorage storage )
218
+ private static Dictionary < ManagedType , InterDomainContext > RestoreRuntimeDataObjects ( RuntimeDataStorage storage )
219
219
{
220
220
var extensions = storage . GetValue < List < ManagedType > > ( "extensions" ) ;
221
221
var internalStores = storage . GetValue < List < CLRObject > > ( "internalStores" ) ;
@@ -245,7 +245,7 @@ private static Dictionary<ManagedType, InterDomainContext> StashPopObjects(Runti
245
245
return storedObjs ;
246
246
}
247
247
248
- private static void StashPushModules ( RuntimeDataStorage storage )
248
+ private static void SaveRuntimeDataModules ( RuntimeDataStorage storage )
249
249
{
250
250
var pyModules = PyImport_GetModuleDict ( ) ;
251
251
var itemsRef = PyDict_Items ( pyModules ) ;
@@ -268,7 +268,7 @@ private static void StashPushModules(RuntimeDataStorage storage)
268
268
storage . AddValue ( "modules" , modules ) ;
269
269
}
270
270
271
- private static void StashPopModules ( RuntimeDataStorage storage )
271
+ private static void RestoreRuntimeDataModules ( RuntimeDataStorage storage )
272
272
{
273
273
var modules = storage . GetValue < Dictionary < IntPtr , IntPtr > > ( "modules" ) ;
274
274
var pyMoudles = PyImport_GetModuleDict ( ) ;
0 commit comments