少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/**
 * \file
 * GC related public interface
 *
 */
#ifndef __METADATA_MONO_GC_H__
#define __METADATA_MONO_GC_H__
 
#include <mono/metadata/object.h>
 
MONO_BEGIN_DECLS
 
typedef int (*MonoGCReferences) (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data);
 
/**
 * This enum is used by the profiler API when reporting root registration.
 */
typedef enum {
    /**
     * Roots external to Mono. Embedders may only use this value.
     */
    MONO_ROOT_SOURCE_EXTERNAL = 0,
    /**
     * Thread call stack.
     *
     * The \c key parameter is a thread ID as a \c uintptr_t.
     */
    MONO_ROOT_SOURCE_STACK = 1,
    /**
     * Roots in the finalizer queue. This is a pseudo-root.
     */
    MONO_ROOT_SOURCE_FINALIZER_QUEUE = 2,
    /**
     * Managed \c static variables.
     *
     * The \c key parameter is a \c MonoVTable pointer.
     */
    MONO_ROOT_SOURCE_STATIC = 3,
    /**
     * Managed \c static variables with \c ThreadStaticAttribute.
     *
     * The \c key parameter is a thread ID as a \c uintptr_t.
     */
    MONO_ROOT_SOURCE_THREAD_STATIC = 4,
    /**
     * Managed \c static variables with \c ContextStaticAttribute.
     *
     * The \c key parameter is a \c MonoAppContext pointer.
     */
    MONO_ROOT_SOURCE_CONTEXT_STATIC = 5,
    /**
     * \c GCHandle structures.
     */
    MONO_ROOT_SOURCE_GC_HANDLE = 6,
    /**
     * Roots in the just-in-time compiler.
     */
    MONO_ROOT_SOURCE_JIT = 7,
    /**
     * Roots in the threading subsystem.
     *
     * The \c key parameter, if not \c NULL, is a thread ID as a \c uintptr_t.
     */
    MONO_ROOT_SOURCE_THREADING = 8,
    /**
     * Roots in application domains.
     *
     * The \c key parameter, if not \c NULL, is a \c MonoDomain pointer.
     */
    MONO_ROOT_SOURCE_DOMAIN = 9,
    /**
     * Roots in reflection code.
     *
     * The \c key parameter, if not \c NULL, is a \c MonoVTable pointer.
     */
    MONO_ROOT_SOURCE_REFLECTION = 10,
    /**
     * Roots from P/Invoke or other marshaling infrastructure.
     */
    MONO_ROOT_SOURCE_MARSHAL = 11,
    /**
     * Roots in the thread pool data structures.
     */
    MONO_ROOT_SOURCE_THREAD_POOL = 12,
    /**
     * Roots in the debugger agent.
     */
    MONO_ROOT_SOURCE_DEBUGGER = 13,
    /**
     * Roots in the runtime handle stack. This is a pseudo-root.
     *
     * The \c key parameter is a thread ID as a \c uintptr_t.
     */
    MONO_ROOT_SOURCE_HANDLE = 14,
} MonoGCRootSource;
 
typedef enum {
    MONO_GC_HANDLE_TYPE_MIN = 0,
    MONO_GC_HANDLE_WEAK = MONO_GC_HANDLE_TYPE_MIN,
    MONO_GC_HANDLE_WEAK_TRACK_RESURRECTION,
    MONO_GC_HANDLE_NORMAL,
    MONO_GC_HANDLE_PINNED,
    MONO_GC_HANDLE_TYPE_MAX,
} MonoGCHandleType;
 
MONO_API void   mono_gc_collect         (int generation);
MONO_API int    mono_gc_collect_a_little ();
MONO_API int    mono_gc_max_generation  (void);
MONO_API int    mono_gc_get_generation  (MonoObject *object);
MONO_API int    mono_gc_collection_count (int generation);
MONO_API int64_t mono_gc_get_used_size   (void);
MONO_API int64_t mono_gc_get_heap_size   (void);
MONO_API int64_t mono_gc_get_max_time_slice_ns ();
MONO_API void   mono_gc_set_max_time_slice_ns (int64_t maxTimeSlice);
MONO_API MonoBoolean mono_gc_pending_finalizers (void);
MONO_API MonoBoolean mono_gc_is_incremental (void);
MONO_API void     mono_gc_set_incremental(MonoBoolean value);
MONO_API void     mono_gc_finalize_notify    (void);
MONO_API int    mono_gc_invoke_finalizers (void);
/* heap walking is only valid in the pre-stop-world event callback */
MONO_API int    mono_gc_walk_heap        (int flags, MonoGCReferences callback, void *data);
 
MONO_END_DECLS
 
#endif /* __METADATA_MONO_GC_H__ */