1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5// This file contains the defintions of all DAC variables that the G
6// exports and that the DAC uses to interface with the GC.
7//
8// This interface has a strict semantic versioning. The following changes require
9// a bump to the major version number:
10// 1. Changing the type of any of these variables,
11// 2. Changing the type layouts of any of the types in gcinterface.dac.h,
12// (dac_generation, dac_heap_segment, dac_finalize_queue)
13// 3. Changing the semantic meaning of any of these variables, such that the DAC's
14// use of them is no longer correct,
15//
16// The following change requires a bump to the minor version number:
17// 1. Adding additional DAC variables.
18//
19// Minor version mismatches are tolerated by the DAC, at the risk of a possibly
20// degraded debugging experience.
21// Major version mismatches are not tolerated by the DAC and will be rejected upon load.
22
23#ifndef GC_DAC_VAR
24 #define GC_DAC_VAR(type, name)
25#endif // GC_DAC_VAR
26
27#ifndef GC_DAC_ARRAY_VAR
28 #define GC_DAC_ARRAY_VAR(type, name) GC_DAC_VAR(type*, name)
29#endif // GC_DAC_ARRAY_VAR
30
31#ifndef GC_DAC_PTR_VAR
32 #define GC_DAC_PTR_VAR(type, name) GC_DAC_VAR(type*, name)
33#endif // GC_DAC_PTR_VAR
34
35// This sequence of macros defines the specific variables that are exposed by the
36// GC to the DAC.
37GC_DAC_VAR (uint8_t, build_variant)
38GC_DAC_VAR (bool, built_with_svr)
39GC_DAC_ARRAY_VAR (size_t, gc_global_mechanisms)
40GC_DAC_ARRAY_VAR (dac_generation, generation_table)
41GC_DAC_VAR (uint32_t, max_gen)
42GC_DAC_PTR_VAR (uint32_t, mark_array)
43GC_DAC_VAR (c_gc_state, current_c_gc_state)
44GC_DAC_PTR_VAR (dac_heap_segment, ephemeral_heap_segment)
45GC_DAC_PTR_VAR (dac_heap_segment, saved_sweep_ephemeral_seg)
46GC_DAC_PTR_VAR (uint8_t, saved_sweep_ephemeral_start)
47GC_DAC_PTR_VAR (uint8_t, background_saved_lowest_address)
48GC_DAC_PTR_VAR (uint8_t, background_saved_highest_address)
49GC_DAC_PTR_VAR (uint8_t, alloc_allocated)
50GC_DAC_PTR_VAR (uint8_t, next_sweep_obj)
51GC_DAC_VAR (oom_history, oom_info)
52GC_DAC_PTR_VAR (dac_finalize_queue, finalize_queue)
53GC_DAC_PTR_VAR (uint8_t*, internal_root_array)
54GC_DAC_VAR (size_t, internal_root_array_index)
55GC_DAC_VAR (BOOL, heap_analyze_success)
56GC_DAC_VAR (int, n_heaps)
57GC_DAC_PTR_VAR (dac_gc_heap*, g_heaps)
58GC_DAC_VAR (int32_t, gc_structures_invalid_cnt)
59GC_DAC_ARRAY_VAR (size_t, interesting_data_per_heap)
60GC_DAC_ARRAY_VAR (size_t, compact_reasons_per_heap)
61GC_DAC_ARRAY_VAR (size_t, expand_mechanisms_per_heap)
62GC_DAC_ARRAY_VAR (size_t, interesting_mechanism_bits_per_heap)
63GC_DAC_VAR (dac_handle_table_map, handle_table_map)
64
65#undef GC_DAC_VAR
66#undef GC_DAC_ARRAY_VAR
67#undef GC_DAC_PTR_VAR
68