Revert "[2020-02] Start a dedicated thread for MERP crash reporting (#21126)" (#21240)
[mono-project.git] / mono / sgen / sgen-pinning.h
blob797e12b2614b29be157f2533f98ec03a96ef59f1
1 /**
2 * \file
3 * All about pinning objects.
5 * Copyright 2011 Xamarin Inc (http://www.xamarin.com)
6 * Copyright (C) 2012 Xamarin Inc
8 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
9 */
10 #ifndef __MONO_SGEN_PINNING_H__
11 #define __MONO_SGEN_PINNING_H__
13 #include "mono/sgen/sgen-pointer-queue.h"
15 enum {
16 PIN_TYPE_STACK,
17 PIN_TYPE_STATIC_DATA,
18 PIN_TYPE_OTHER,
19 PIN_TYPE_MAX
22 void sgen_pinning_init (void);
23 void sgen_pin_stage_ptr (void *ptr);
24 void sgen_optimize_pin_queue (void);
25 void sgen_init_pinning (void);
26 void sgen_init_pinning_for_conc (void);
27 void sgen_finish_pinning_for_conc (void);
28 void sgen_finish_pinning (void);
29 void sgen_pinning_register_pinned_in_nursery (GCObject *obj);
30 void sgen_scan_pin_queue_objects (ScanCopyContext ctx);
31 void sgen_pin_queue_clear_discarded_entries (GCMemSection *section, size_t max_pin_slot);
32 size_t sgen_get_pinned_count (void);
33 void sgen_pinning_setup_section (GCMemSection *section);
34 void sgen_pinning_trim_queue_to_section (GCMemSection *section);
36 void sgen_dump_pin_queue (void);
38 gboolean sgen_find_optimized_pin_queue_area (void *start, void *end, size_t *first_out, size_t *last_out);
39 void sgen_find_section_pin_queue_start_end (GCMemSection *section);
40 void** sgen_pinning_get_entry (size_t index);
41 void sgen_pin_objects_in_section (GCMemSection *section, ScanCopyContext ctx);
43 /* Pinning stats */
45 void sgen_pin_stats_register_address (char *addr, int pin_type);
46 size_t sgen_pin_stats_get_pinned_byte_count (int pin_type);
47 SgenPointerQueue *sgen_pin_stats_get_object_list (void);
48 void sgen_pin_stats_reset (void);
50 /* Perpetual pinning, aka cementing */
52 void sgen_cement_init (gboolean enabled);
53 void sgen_cement_reset (void);
54 void sgen_cement_force_pinned (void);
55 gboolean sgen_cement_is_forced (GCObject *obj);
56 gboolean sgen_cement_lookup (GCObject *obj);
57 gboolean sgen_cement_lookup_or_register (GCObject *obj);
58 void sgen_pin_cemented_objects (void);
59 void sgen_cement_clear_below_threshold (void);
61 #endif