First set of licensing changes
[mono.git] / mono / metadata / sgen-bridge-internals.h
1 /*
2  * sgen-bridge-internals.h: The cross-GC bridge.
3  *
4  * Copyright (C) 2015 Xamarin Inc
5  *
6  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
7  */
8
9 #ifndef __MONO_SGENBRIDGEINTERNAL_H__
10 #define __MONO_SGENBRIDGEINTERNAL_H__
11
12 #include "config.h"
13
14 #ifdef HAVE_SGEN_GC
15
16 #include "mono/utils/mono-compiler.h"
17
18 #include "mono/sgen/sgen-gc.h"
19 #include "mono/metadata/sgen-bridge.h"
20
21 extern volatile gboolean bridge_processing_in_progress;
22 extern MonoGCBridgeCallbacks bridge_callbacks;
23
24 gboolean sgen_need_bridge_processing (void);
25 void sgen_bridge_reset_data (void);
26 void sgen_bridge_processing_stw_step (void);
27 void sgen_bridge_processing_finish (int generation);
28 gboolean sgen_is_bridge_object (GCObject *obj);
29 MonoGCBridgeObjectKind sgen_bridge_class_kind (MonoClass *klass);
30 void sgen_bridge_register_finalized_object (GCObject *object);
31 void sgen_bridge_describe_pointer (GCObject *object);
32
33 gboolean sgen_is_bridge_object (GCObject *obj);
34 void sgen_mark_bridge_object (GCObject *obj);
35
36 gboolean sgen_bridge_handle_gc_debug (const char *opt);
37 void sgen_bridge_print_gc_debug_usage (void);
38
39 typedef struct {
40         void (*reset_data) (void);
41         void (*processing_stw_step) (void);
42         void (*processing_build_callback_data) (int generation);
43         void (*processing_after_callback) (int generation);
44         MonoGCBridgeObjectKind (*class_kind) (MonoClass *klass);
45         void (*register_finalized_object) (GCObject *object);
46         void (*describe_pointer) (GCObject *object);
47         void (*enable_accounting) (void);
48         void (*set_dump_prefix) (const char *prefix);
49
50         /*
51          * These are set by processing_build_callback_data().
52          */
53         int num_sccs;
54         MonoGCBridgeSCC **api_sccs;
55
56         int num_xrefs;
57         MonoGCBridgeXRef *api_xrefs;
58 } SgenBridgeProcessor;
59
60 void sgen_old_bridge_init (SgenBridgeProcessor *collector);
61 void sgen_new_bridge_init (SgenBridgeProcessor *collector);
62 void sgen_tarjan_bridge_init (SgenBridgeProcessor *collector);
63 void sgen_set_bridge_implementation (const char *name);
64 void sgen_bridge_set_dump_prefix (const char *prefix);
65
66 #endif
67
68 #endif