14
14
#include " xxhash.hh"
15
15
#include " startup-aware-lock.hh"
16
16
#include " jni-remapping.hh"
17
+ #include " internal-pinvokes.hh"
17
18
18
19
extern " C" {
19
20
int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap);
@@ -31,26 +32,26 @@ void* MonodroidRuntime::system_native_library_handle = nullptr;
31
32
void * MonodroidRuntime::system_security_cryptography_native_android_library_handle = nullptr ;
32
33
void * MonodroidRuntime::system_io_compression_native_library_handle = nullptr ;
33
34
34
- static unsigned int
35
+ unsigned int
35
36
monodroid_get_log_categories ()
36
37
{
37
38
return log_categories;
38
39
}
39
40
40
- static int
41
+ int
41
42
monodroid_get_system_property (const char *name, char **value)
42
43
{
43
44
return AndroidSystem::monodroid_get_system_property (name, value);
44
45
}
45
46
46
- static int
47
+ int
47
48
monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix)
48
49
{
49
50
embeddedAssemblies.set_assemblies_prefix (prefix);
50
51
return 0 ;
51
52
}
52
53
53
- static void
54
+ void
54
55
monodroid_log (LogLevel level, LogCategories category, const char *message)
55
56
{
56
57
switch (level) {
@@ -84,99 +85,99 @@ monodroid_log (LogLevel level, LogCategories category, const char *message)
84
85
}
85
86
}
86
87
87
- static void
88
+ void
88
89
monodroid_free (void *ptr)
89
90
{
90
91
free (ptr);
91
92
}
92
93
93
- static int
94
+ int
94
95
_monodroid_max_gref_get ()
95
96
{
96
97
return static_cast <int >(AndroidSystem::get_max_gref_count ());
97
98
}
98
99
99
- static int
100
+ int
100
101
_monodroid_gref_get ()
101
102
{
102
103
return osBridge.get_gc_gref_count ();
103
104
}
104
105
105
106
106
- static void
107
+ void
107
108
_monodroid_gref_log (const char *message)
108
109
{
109
110
osBridge._monodroid_gref_log (message);
110
111
}
111
112
112
- static int
113
+ int
113
114
_monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable)
114
115
{
115
116
return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable);
116
117
}
117
118
118
- static void
119
+ void
119
120
_monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable)
120
121
{
121
122
osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable);
122
123
}
123
124
124
- static int
125
+ int
125
126
_monodroid_weak_gref_get ()
126
127
{
127
128
return osBridge.get_gc_weak_gref_count ();
128
129
}
129
130
130
- static void
131
+ void
131
132
_monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable)
132
133
{
133
134
osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable);
134
135
}
135
136
136
- static void
137
+ void
137
138
_monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable)
138
139
{
139
140
osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable);
140
141
}
141
142
142
- static void
143
+ void
143
144
_monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable)
144
145
{
145
146
osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable);
146
147
}
147
148
148
- static void
149
+ void
149
150
_monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable)
150
151
{
151
152
osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable);
152
153
}
153
154
154
- static void
155
+ void
155
156
_monodroid_gc_wait_for_bridge_processing ()
156
157
{
157
158
mono_gc_wait_for_bridge_processing ();
158
159
}
159
160
160
- static int
161
+ int
161
162
_monodroid_get_android_api_level ()
162
163
{
163
164
return monodroidRuntime.get_android_api_level ();
164
165
}
165
166
166
- static void
167
+ void
167
168
monodroid_clear_gdb_wait ()
168
169
{
169
170
monodroidRuntime.set_monodroid_gdb_wait (false );
170
171
}
171
172
172
- static void *
173
+ void *
173
174
_monodroid_get_identity_hash_code (JNIEnv *env, void *v)
174
175
{
175
176
intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v);
176
177
return (void *) rv;
177
178
}
178
179
179
- static void *
180
+ void *
180
181
_monodroid_timezone_get_default_id ()
181
182
{
182
183
JNIEnv *env = osBridge.ensure_jnienv ();
@@ -202,15 +203,15 @@ _monodroid_timezone_get_default_id ()
202
203
return def_id;
203
204
}
204
205
205
- static void
206
+ void
206
207
_monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args)
207
208
{
208
209
#if !defined (NET)
209
210
monodroidRuntime.dump_counters_v (format, args);
210
211
#endif // ndef NET
211
212
}
212
213
213
- static managed_timing_sequence*
214
+ managed_timing_sequence*
214
215
monodroid_timing_start (const char *message)
215
216
{
216
217
if (timing == nullptr )
@@ -225,7 +226,7 @@ monodroid_timing_start (const char *message)
225
226
return ret;
226
227
}
227
228
228
- static void
229
+ void
229
230
monodroid_timing_stop (managed_timing_sequence *sequence, const char *message)
230
231
{
231
232
static constexpr const char DEFAULT_MESSAGE[] = " Managed Timing" ;
@@ -238,19 +239,19 @@ monodroid_timing_stop (managed_timing_sequence *sequence, const char *message)
238
239
timing->release_sequence (sequence);
239
240
}
240
241
241
- static char **
242
+ char **
242
243
monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens)
243
244
{
244
245
return Util::monodroid_strsplit (str, delimiter, max_tokens);
245
246
}
246
247
247
- static void
248
+ void
248
249
monodroid_strfreev (char **str_array)
249
250
{
250
251
Util::monodroid_strfreev (str_array);
251
252
}
252
253
253
- static char *
254
+ char *
254
255
monodroid_strdup_printf (const char *format, ...)
255
256
{
256
257
va_list args;
@@ -262,65 +263,65 @@ monodroid_strdup_printf (const char *format, ...)
262
263
return ret;
263
264
}
264
265
265
- static char *
266
+ char *
266
267
monodroid_TypeManager_get_java_class_name (jclass klass)
267
268
{
268
269
return monodroidRuntime.get_java_class_name_for_TypeManager (klass);
269
270
}
270
271
271
- static int
272
+ int
272
273
monodroid_get_namespaced_system_property (const char *name, char **value)
273
274
{
274
275
return static_cast <int >(AndroidSystem::monodroid_get_system_property (name, value));
275
276
}
276
277
277
- static FILE*
278
+ FILE*
278
279
monodroid_fopen (const char * filename, const char * mode)
279
280
{
280
281
return Util::monodroid_fopen (filename, mode);
281
282
}
282
283
283
- static int
284
+ int
284
285
send_uninterrupted (int fd, void *buf, int len)
285
286
{
286
287
if (len < 0 )
287
288
len = 0 ;
288
289
return Util::send_uninterrupted (fd, buf, static_cast <size_t >(len));
289
290
}
290
291
291
- static int
292
+ int
292
293
recv_uninterrupted (int fd, void *buf, int len)
293
294
{
294
295
if (len < 0 )
295
296
len = 0 ;
296
297
return static_cast <int >(Util::recv_uninterrupted (fd, buf, static_cast <size_t >(len)));
297
298
}
298
299
299
- static void
300
+ void
300
301
set_world_accessable (const char *path)
301
302
{
302
303
Util::set_world_accessable (path);
303
304
}
304
305
305
- static void
306
+ void
306
307
create_public_directory (const char *dir)
307
308
{
308
309
Util::create_public_directory (dir);
309
310
}
310
311
311
- static char *
312
+ char *
312
313
path_combine (const char *path1, const char *path2)
313
314
{
314
315
return Util::path_combine (path1, path2);
315
316
}
316
317
317
- static void *
318
+ void *
318
319
monodroid_dylib_mono_new ([[maybe_unused]] const char *libmono_path)
319
320
{
320
321
return nullptr ;
321
322
}
322
323
323
- static void
324
+ void
324
325
monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports)
325
326
{
326
327
// no-op
@@ -332,33 +333,33 @@ monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports)
332
333
333
334
it should also accept libmono_path = nullptr parameter
334
335
*/
335
- static int
336
+ int
336
337
monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path)
337
338
{
338
339
if (mono_imports == nullptr )
339
340
return FALSE ;
340
341
return TRUE ;
341
342
}
342
343
343
- static void *
344
- monodroid_get_dylib (void )
344
+ void *
345
+ monodroid_get_dylib ()
345
346
{
346
347
return nullptr ;
347
348
}
348
349
349
- static const char *
350
+ const char *
350
351
_monodroid_lookup_replacement_type (const char *jniSimpleReference)
351
352
{
352
353
return JniRemapping::lookup_replacement_type (jniSimpleReference);
353
354
}
354
355
355
- static const JniRemappingReplacementMethod*
356
+ const JniRemappingReplacementMethod*
356
357
_monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature)
357
358
{
358
359
return JniRemapping::lookup_replacement_method_info (jniSourceType, jniMethodName, jniMethodSignature);
359
360
}
360
361
361
- static void
362
+ void
362
363
monodroid_log_traces (uint32_t kind, const char *first_line)
363
364
{
364
365
JNIEnv *env = osBridge.ensure_jnienv ();
0 commit comments