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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
|
/**************************************************************************/
/* */
/* OCaml */
/* */
/* KC Sivaramakrishnan, Indian Institute of Technology, Madras */
/* Stephen Dolan, University of Cambridge */
/* */
/* Copyright 2019 Indian Institute of Technology, Madras */
/* Copyright 2019 University of Cambridge */
/* */
/* All rights reserved. This file is distributed under the terms of */
/* the GNU Lesser General Public License version 2.1, with the */
/* special exception on linking described in the file LICENSE. */
/* */
/**************************************************************************/
DOMAIN_STATE(atomic_uintnat, young_limit)
/* Minor heap limit. Typically [young_start] <= [young_limit] <=
* [young_end], but this field can be set atomically to UINTNAT_MAX by
* another thread (typically from another domain), or by the memory
* profiler, in order to interrupt this domain (by causing an
* allocation failure). Setting [young_limit] to UINTNAT_MAX can be
* done safely at any time whatsoever by any thread. To avoid races,
* setting [young_limit] to anything else than UINTNAT_MAX should only
* be done via [caml_reset_young_limit] by the domain itself. */
DOMAIN_STATE(value*, young_ptr)
/* Minor heap pointer */
DOMAIN_STATE(value*, young_start)
/* Start of the minor heap */
DOMAIN_STATE(value*, young_end)
/* End of the minor heap. always(young_start <= young_ptr <= young_end) */
DOMAIN_STATE(value*, young_trigger)
/* Input for setting the young_limit */
DOMAIN_STATE(struct stack_info*, current_stack)
/* Current stack */
DOMAIN_STATE(void*, exn_handler)
/* Pointer into the current stack */
DOMAIN_STATE(intnat, action_pending)
/* Whether we are due to start the processing of delayable pending
actions. See runtime/signal.c. Valid values: 0,1. */
DOMAIN_STATE(struct c_stack_link*, c_stack)
/* The C stack associated with this domain.
* Used by this domain to perform external calls. */
DOMAIN_STATE(struct stack_info**, stack_cache)
/* This is a list of freelist buckets of stacks */
DOMAIN_STATE(value*, gc_regs_buckets)
/* Cache of free gc_regs buckets.
Documented in fiber.h. */
DOMAIN_STATE(value*, gc_regs)
/* Pointer to currently-used register bucket, or NULL.
Documented in fiber.h. */
DOMAIN_STATE(struct caml_minor_tables*, minor_tables)
DOMAIN_STATE(struct mark_stack*, mark_stack)
/* Mark stack */
DOMAIN_STATE(uintnat, marking_done)
/* Is marking done for the current major cycle. */
DOMAIN_STATE(uintnat, sweeping_done)
/* Is sweeping done for the current major cycle. */
DOMAIN_STATE(uintnat, allocated_words)
/* Number of words allocated in the major heap (by promotion or
direct allocation) since the latest slice. */
DOMAIN_STATE(uintnat, allocated_words_direct)
/* Subset of [allocated_words] that was allocated directly to the
major heap since the latest slice. */
DOMAIN_STATE(uintnat, allocated_words_suspended)
/* Subset of [allocated_words] that were allocated in ramp-up
phases since the latest slice.
The corresponding deallocation work is "suspended" for later
ramp-down phases, instead of being performed in the next slice. */
DOMAIN_STATE(uintnat, allocated_words_resumed)
/* A number of allocated words (disjoint from [allocated_words])
whose deallocation work was suspended by a previous ramp-up phase,
and was resumed during a ramp-down phase since the latest slice. */
DOMAIN_STATE(intnat, current_ramp_up_allocated_words_diff)
/* The total number of suspended deallocation words for the current ramp-up
phase is [allocated_suspended + current_ramp_up_allocated_words_diff].
When [current_ramp_up_allocated_words_diff] is positive, it adds
allocations that happened during the current ramp-up phase but
before the latest slice.
When [current_ramp_up_allocated_words_diff] is negative, it
subtracts allocations that happened since the latest slice but
during a previous ramp-up phase.
(Instead of tracking a difference, we could count the total
number of suspended deallocation of the ramp_up phase, but
this would require additional work to increment this value
in [caml_update_major_allocated_words].)
*/
DOMAIN_STATE(uintnat, swept_words)
DOMAIN_STATE(caml_gc_policy, gc_policy)
/* Domain-local GC policy setting. */
DOMAIN_STATE(uintnat, major_slice_epoch)
DOMAIN_STATE(struct caml__roots_block*, local_roots)
DOMAIN_STATE(struct caml_ephe_info*, ephe_info)
DOMAIN_STATE(struct caml_final_info*, final_info)
DOMAIN_STATE(intnat, backtrace_pos)
DOMAIN_STATE(intnat, backtrace_active)
DOMAIN_STATE(backtrace_slot*, backtrace_buffer)
DOMAIN_STATE(value, backtrace_last_exn)
DOMAIN_STATE(intnat, compare_unordered)
DOMAIN_STATE(uintnat, oo_next_id_local)
DOMAIN_STATE(uintnat, requested_major_slice)
DOMAIN_STATE(uintnat, requested_global_major_slice)
DOMAIN_STATE(uintnat, requested_minor_gc)
DOMAIN_STATE(atomic_uintnat, requested_external_interrupt)
DOMAIN_STATE(int, parser_trace)
/* See parsing.c */
DOMAIN_STATE(asize_t, minor_heap_wsz)
DOMAIN_STATE(struct caml_heap_state*, shared_heap)
DOMAIN_STATE(int, id)
DOMAIN_STATE(int, unique_id)
DOMAIN_STATE(value, dls_root)
/* Domain-local state */
DOMAIN_STATE(double, extra_heap_resources)
DOMAIN_STATE(double, extra_heap_resources_minor)
DOMAIN_STATE(uintnat, dependent_size)
DOMAIN_STATE(uintnat, dependent_allocated)
/* How much work needs to be done (by all domains) before we stop this slice. */
DOMAIN_STATE(intnat, slice_target)
/* Minimum amount of work to do in this slice by this domain. */
DOMAIN_STATE(intnat, slice_budget)
/* Accounting for sweeping work done while allocating. */
DOMAIN_STATE(intnat, major_work_done_between_slices)
DOMAIN_STATE(struct caml_extern_state*, extern_state)
DOMAIN_STATE(struct caml_intern_state*, intern_state)
/*****************************************************************************/
/* GC stats (see gc_ctrl.c and the Gc module). */
/* These stats represent only the current domain's respective values. */
/* Use the Gc module to get aggregated total program stats. */
/*****************************************************************************/
DOMAIN_STATE(uintnat, stat_minor_words)
DOMAIN_STATE(uintnat, stat_promoted_words)
DOMAIN_STATE(uintnat, stat_major_words)
DOMAIN_STATE(intnat, stat_forced_major_collections)
DOMAIN_STATE(uintnat, stat_blocks_marked)
/*****************************************************************************/
DOMAIN_STATE(int, inside_stw_handler)
/* whether or not a domain is inside of a stop-the-world handler
this is used for several debug assertions inside of methods
that can only be called from either in or outside this state. */
DOMAIN_STATE(intnat, trap_sp_off)
DOMAIN_STATE(intnat, trap_barrier_off)
DOMAIN_STATE(int64_t, trap_barrier_block)
DOMAIN_STATE(struct caml_exception_context*, external_raise)
/* Bytecode TLS vars, not used for native code */
DOMAIN_STATE(struct memprof_domain_s *, memprof)
DOMAIN_STATE(value *, memprof_young_trigger)
DOMAIN_STATE(extra_params_area, extra_params)
/* This member must occur last, because it is an array, not a scalar */
|