From 5918de4f56a60b968d6ac18f9c549642c9915d67 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 25 Oct 2024 10:58:24 +1100 Subject: [PATCH] Updating dev (#186) Backporting https://github.com/mmtk/mmtk-julia/pull/180, merge with https://github.com/mmtk/julia/pull/67. --- .github/scripts/ci-test-LinearAlgebra.sh | 2 +- .github/scripts/common.sh | 2 +- .github/workflows/binding-tests.yml | 12 + .github/workflows/ci.yml | 2 +- julia/mmtk_julia.c | 565 --- julia/mmtk_julia.h | 8 - julia/mmtk_julia_types.h | 688 ---- mmtk/Cargo.lock | 89 + mmtk/Cargo.toml | 6 +- mmtk/api/mmtk.h | 40 +- mmtk/build.rs | 74 + mmtk/src/active_plan.rs | 8 +- mmtk/src/api.rs | 11 - mmtk/src/collection.rs | 19 +- mmtk/src/julia_finalizer.rs | 18 +- mmtk/src/julia_scanning.rs | 152 +- mmtk/src/julia_types.rs | 4231 ---------------------- mmtk/src/lib.rs | 49 +- mmtk/src/object_model.rs | 65 +- mmtk/src/reference_glue.rs | 10 +- mmtk/src/scanning.rs | 21 +- mmtk/src/util.rs | 49 +- 22 files changed, 362 insertions(+), 5759 deletions(-) delete mode 100644 julia/mmtk_julia.c delete mode 100644 julia/mmtk_julia.h delete mode 100644 julia/mmtk_julia_types.h create mode 100644 mmtk/build.rs delete mode 100644 mmtk/src/julia_types.rs diff --git a/.github/scripts/ci-test-LinearAlgebra.sh b/.github/scripts/ci-test-LinearAlgebra.sh index f16a8e55..7968b717 100755 --- a/.github/scripts/ci-test-LinearAlgebra.sh +++ b/.github/scripts/ci-test-LinearAlgebra.sh @@ -5,7 +5,7 @@ set -e . $(dirname "$0")/common.sh -export MMTK_MAX_HSIZE_G=7.5 +export MMTK_MAX_HSIZE_G=8 total_mem=$(free -m | awk '/^Mem:/ {print $2}') mem_threshold=512 # use 0.5Gb as a threshold for the max rss based on the total free memory total_mem_restricted=$((total_mem- mem_threshold)) diff --git a/.github/scripts/common.sh b/.github/scripts/common.sh index 3325c1af..7b10c356 100644 --- a/.github/scripts/common.sh +++ b/.github/scripts/common.sh @@ -1,5 +1,5 @@ BINDING_PATH=$(realpath $(dirname "$0"))/../.. -JULIA_PATH=$BINDING_PATH/vm/julia +export JULIA_PATH=$BINDING_PATH/vm/julia RUSTUP_TOOLCHAIN=`cat $BINDING_PATH/mmtk/rust-toolchain` JULIA_TEST_ARGS='--check-bounds=yes --startup-file=no --depwarn=error' diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index 64a68141..8851e4f3 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -19,6 +19,9 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh + # removing these as they cause a conflict within bindgen + sudo rm -rf /usr/lib/llvm-14 + sudo rm -rf /usr/lib/llvm-13 - name: Build Julia (Debug) run: | ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} @@ -35,6 +38,9 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh + # removing these as they cause a conflict within bindgen + sudo rm -rf /usr/lib/llvm-14 + sudo rm -rf /usr/lib/llvm-13 - name: Patching unsupported tests run: | ./.github/scripts/ci-test-patching.sh @@ -54,6 +60,9 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh + # removing these as they cause a conflict within bindgen + sudo rm -rf /usr/lib/llvm-14 + sudo rm -rf /usr/lib/llvm-13 - name: Patching unsupported tests run: | ./.github/scripts/ci-test-patching.sh @@ -73,6 +82,9 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh + # removing these as they cause a conflict within bindgen + sudo rm -rf /usr/lib/llvm-14 + sudo rm -rf /usr/lib/llvm-13 - name: Build Julia (Release) run: | ./.github/scripts/ci-build.sh release ${{ inputs.gc_plan }} ${{ inputs.moving }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b5e7cca..8e6dd7bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,4 +23,4 @@ jobs: uses: ./.github/workflows/binding-tests.yml with: gc_plan: ${{ matrix.gc_plan }} - moving: ${{ matrix.moving }} + moving: ${{ matrix.moving }} \ No newline at end of file diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c deleted file mode 100644 index ed7cd44e..00000000 --- a/julia/mmtk_julia.c +++ /dev/null @@ -1,565 +0,0 @@ -#include "mmtk_julia.h" -#include "mmtk.h" -#include "gc-mmtk.h" -#include "mmtk_julia_types.h" -#include -#include -#include "gc-common.h" -#include "threading.h" - -extern int64_t perm_scanned_bytes; -extern void run_finalizer(jl_task_t *ct, void *o, void *ff); -extern int gc_n_threads; -extern jl_ptls_t* gc_all_tls_states; -extern jl_value_t *cmpswap_names JL_GLOBALLY_ROOTED; -extern jl_genericmemory_t *jl_global_roots_list JL_GLOBALLY_ROOTED; -extern jl_genericmemory_t *jl_global_roots_keyset JL_GLOBALLY_ROOTED; -extern jl_typename_t *jl_array_typename JL_GLOBALLY_ROOTED; -extern long BI_METADATA_START_ALIGNED_DOWN; -extern long BI_METADATA_END_ALIGNED_UP; -extern uint64_t finalizer_rngState[JL_RNG_SIZE]; -extern const unsigned pool_sizes[]; -extern size_t mmtk_get_obj_size(void* obj); -extern void jl_rng_split(uint64_t to[JL_RNG_SIZE], uint64_t from[JL_RNG_SIZE]); -extern void _jl_free_stack(jl_ptls_t ptls, void *stkbuf, size_t bufsz); -extern void free_stack(void *stkbuf, size_t bufsz); -extern jl_mutex_t finalizers_lock; -extern void jl_gc_wait_for_the_world(jl_ptls_t* gc_all_tls_states, int gc_n_threads); -extern void mmtk_block_thread_for_gc(void); -extern int64_t live_bytes; -extern void jl_throw_out_of_memory_error(void); -extern uint32_t jl_get_gc_disable_counter(void); - - -extern void* new_mutator_iterator(void); -extern jl_ptls_t get_next_mutator_tls(void*); -extern void* close_mutator_iterator(void*); - -JL_DLLEXPORT void (jl_mmtk_harness_begin)(void) -{ - jl_ptls_t ptls = jl_current_task->ptls; - mmtk_harness_begin(ptls); -} - -JL_DLLEXPORT void (jl_mmtk_harness_end)(void) -{ - mmtk_harness_end(); -} - -// This is used in mmtk_sweep_malloced_memory and it is slightly different -// from jl_gc_free_memory from gc-stock.c as the stock GC updates the -// information in the global variable gc_heap_stats (which is specific to the stock GC) -static void jl_gc_free_memory(jl_value_t *v, int isaligned) JL_NOTSAFEPOINT -{ - assert(jl_is_genericmemory(v)); - jl_genericmemory_t *m = (jl_genericmemory_t*)v; - assert(jl_genericmemory_how(m) == 1 || jl_genericmemory_how(m) == 2); - char *d = (char*)m->ptr; - if (isaligned) - jl_free_aligned(d); - else - free(d); - gc_num.freed += jl_genericmemory_nbytes(m); - gc_num.freecall++; -} - -static void mmtk_sweep_malloced_memory(void) JL_NOTSAFEPOINT -{ - void* iter = new_mutator_iterator(); - jl_ptls_t ptls2 = get_next_mutator_tls(iter); - while(ptls2 != NULL) { - mallocmemory_t *ma = ptls2->gc_tls_common.heap.mallocarrays; - mallocmemory_t **pma = &ptls2->gc_tls_common.heap.mallocarrays; - while (ma != NULL) { - mallocmemory_t *nxt = ma->next; - jl_value_t *a = (jl_value_t*)((uintptr_t)ma->a & ~1); - if (!mmtk_object_is_managed_by_mmtk(a)) { - pma = &ma->next; - ma = nxt; - continue; - } - if (mmtk_is_live_object(a)) { - // if the array has been forwarded, the reference needs to be updated - jl_genericmemory_t *maybe_forwarded = (jl_genericmemory_t*)mmtk_get_possibly_forwared(ma->a); - ma->a = maybe_forwarded; - pma = &ma->next; - } - else { - *pma = nxt; - int isaligned = (uintptr_t)ma->a & 1; - jl_gc_free_memory(a, isaligned); - ma->next = ptls2->gc_tls_common.heap.mafreelist; - ptls2->gc_tls_common.heap.mafreelist = ma; - } - ma = nxt; - } - ptls2 = get_next_mutator_tls(iter); - } - gc_sweep_sysimg(); - close_mutator_iterator(iter); -} - -void mmtk_wait_in_a_safepoint(void) { - jl_ptls_t ptls = jl_current_task->ptls; - jl_gc_safepoint_(ptls); -} - -void mmtk_exit_from_safepoint(int8_t old_state) { - jl_ptls_t ptls = jl_current_task->ptls; - jl_gc_state_set(ptls, old_state, JL_GC_STATE_WAITING); -} - -// based on jl_gc_collect from gc.c -JL_DLLEXPORT void jl_gc_prepare_to_collect(void) -{ - // FIXME: set to JL_GC_AUTO since we're calling it from mmtk - // maybe just remove this? - JL_PROBE_GC_BEGIN(JL_GC_AUTO); - - jl_task_t *ct = jl_current_task; - jl_ptls_t ptls = ct->ptls; - if (jl_atomic_load_acquire(&jl_gc_disable_counter)) { - size_t localbytes = jl_atomic_load_relaxed(&ptls->gc_tls_common.gc_num.allocd) + gc_num.interval; - jl_atomic_store_relaxed(&ptls->gc_tls_common.gc_num.allocd, -(int64_t)gc_num.interval); - static_assert(sizeof(_Atomic(uint64_t)) == sizeof(gc_num.deferred_alloc), ""); - jl_atomic_fetch_add_relaxed((_Atomic(uint64_t)*)&gc_num.deferred_alloc, localbytes); - return; - } - - int8_t old_state = jl_atomic_load_relaxed(&ptls->gc_state); - jl_atomic_store_release(&ptls->gc_state, JL_GC_STATE_WAITING); - // `jl_safepoint_start_gc()` makes sure only one thread can run the GC. - uint64_t t0 = jl_hrtime(); - if (!jl_safepoint_start_gc()) { - jl_gc_state_set(ptls, old_state, JL_GC_STATE_WAITING); - jl_safepoint_wait_thread_resume(); // block in thread-suspend now if requested, after clearing the gc_state - return; - } - - JL_TIMING_SUSPEND_TASK(GC, ct); - JL_TIMING(GC, GC); - - int last_errno = errno; -#ifdef _OS_WINDOWS_ - DWORD last_error = GetLastError(); -#endif - // Now we are ready to wait for other threads to hit the safepoint, - // we can do a few things that doesn't require synchronization. - // - // We must sync here with the tls_lock operations, so that we have a - // seq-cst order between these events now we know that either the new - // thread must run into our safepoint flag or we must observe the - // existence of the thread in the jl_n_threads count. - // - // TODO: concurrently queue objects - jl_fence(); - gc_n_threads = jl_atomic_load_acquire(&jl_n_threads); - gc_all_tls_states = jl_atomic_load_relaxed(&jl_all_tls_states); - jl_gc_wait_for_the_world(gc_all_tls_states, gc_n_threads); - JL_PROBE_GC_STOP_THE_WORLD(); - - uint64_t t1 = jl_hrtime(); - uint64_t duration = t1 - t0; - if (duration > gc_num.max_time_to_safepoint) - gc_num.max_time_to_safepoint = duration; - gc_num.time_to_safepoint = duration; - gc_num.total_time_to_safepoint += duration; - - if (!jl_atomic_load_acquire(&jl_gc_disable_counter)) { - JL_LOCK_NOGC(&finalizers_lock); // all the other threads are stopped, so this does not make sense, right? otherwise, failing that, this seems like plausibly a deadlock -#ifndef __clang_gcanalyzer__ - mmtk_block_thread_for_gc(); -#endif - JL_UNLOCK_NOGC(&finalizers_lock); - } - - gc_n_threads = 0; - gc_all_tls_states = NULL; - jl_safepoint_end_gc(); - jl_gc_state_set(ptls, old_state, JL_GC_STATE_WAITING); - JL_PROBE_GC_END(); - jl_safepoint_wait_thread_resume(); // block in thread-suspend now if requested, after clearing the gc_state - - // Only disable finalizers on current thread - // Doing this on all threads is racy (it's impossible to check - // or wait for finalizers on other threads without dead lock). - if (!ptls->finalizers_inhibited && ptls->locks.len == 0) { - JL_TIMING(GC, GC_Finalizers); - run_finalizers(ct, 0); - } - JL_PROBE_GC_FINALIZER(); - -#ifdef _OS_WINDOWS_ - SetLastError(last_error); -#endif - errno = last_errno; -} - -extern void run_finalizers(jl_task_t *ct, int finalizers_thread); - -// We implement finalization in the binding side. These functions -// returns some pointers so MMTk can manipulate finalizer lists. - -extern jl_mutex_t finalizers_lock; -extern arraylist_t to_finalize; -extern arraylist_t finalizer_list_marked; - -void* get_thread_finalizer_list(void* ptls_raw) { - jl_ptls_t ptls = (jl_ptls_t) ptls_raw; - return (void*)&ptls->finalizers; -} - -void* get_to_finalize_list(void) { - return (void*)&to_finalize; -} - -void* get_marked_finalizers_list(void) { - return (void*)&finalizer_list_marked; -} - -int* get_jl_gc_have_pending_finalizers(void) { - return (int*)&jl_gc_have_pending_finalizers; -} - -static void add_node_to_roots_buffer(RootsWorkClosure* closure, RootsWorkBuffer* buf, size_t* buf_len, void* root) { - if (root == NULL) - return; - - buf->ptr[*buf_len] = root; - *buf_len += 1; - if (*buf_len >= buf->cap) { - RootsWorkBuffer new_buf = (closure->report_nodes_func)(buf->ptr, *buf_len, buf->cap, closure->data, true); - *buf = new_buf; - *buf_len = 0; - } -} - -static void add_node_to_tpinned_roots_buffer(RootsWorkClosure* closure, RootsWorkBuffer* buf, size_t* buf_len, void* root) { - if (root == NULL) - return; - - buf->ptr[*buf_len] = root; - *buf_len += 1; - if (*buf_len >= buf->cap) { - RootsWorkBuffer new_buf = (closure->report_tpinned_nodes_func)(buf->ptr, *buf_len, buf->cap, closure->data, true); - *buf = new_buf; - *buf_len = 0; - } -} - -void scan_vm_specific_roots(RootsWorkClosure* closure) -{ - // Create a new buf - RootsWorkBuffer buf = (closure->report_nodes_func)((void**)0, 0, 0, closure->data, true); - size_t len = 0; - - // add module - add_node_to_roots_buffer(closure, &buf, &len, jl_main_module); - - // buildin values - add_node_to_roots_buffer(closure, &buf, &len, jl_an_empty_vec_any); - add_node_to_roots_buffer(closure, &buf, &len, jl_module_init_order); - for (size_t i = 0; i < jl_current_modules.size; i += 2) { - if (jl_current_modules.table[i + 1] != HT_NOTFOUND) { - add_node_to_roots_buffer(closure, &buf, &len, jl_current_modules.table[i]); - } - } - add_node_to_roots_buffer(closure, &buf, &len, jl_anytuple_type_type); - for (size_t i = 0; i < N_CALL_CACHE; i++) { - jl_typemap_entry_t *v = jl_atomic_load_relaxed(&call_cache[i]); - add_node_to_roots_buffer(closure, &buf, &len, v); - } - add_node_to_roots_buffer(closure, &buf, &len, _jl_debug_method_invalidation); - - // constants - add_node_to_roots_buffer(closure, &buf, &len, jl_emptytuple_type); - add_node_to_roots_buffer(closure, &buf, &len, cmpswap_names); - - // jl_global_roots_table must be transitively pinned - RootsWorkBuffer tpinned_buf = (closure->report_tpinned_nodes_func)((void**)0, 0, 0, closure->data, true); - size_t tpinned_len = 0; - add_node_to_tpinned_roots_buffer(closure, &tpinned_buf, &tpinned_len, jl_global_roots_list); - add_node_to_tpinned_roots_buffer(closure, &tpinned_buf, &tpinned_len, jl_global_roots_keyset); - - // Push the result of the work. - (closure->report_nodes_func)(buf.ptr, len, buf.cap, closure->data, false); - (closure->report_tpinned_nodes_func)(tpinned_buf.ptr, tpinned_len, tpinned_buf.cap, closure->data, false); -} - -JL_DLLEXPORT void scan_julia_exc_obj(void* obj_raw, void* closure, ProcessSlotFn process_slot) { - jl_task_t *ta = (jl_task_t*)obj_raw; - - if (ta->excstack) { // inlining label `excstack` from mark_loop - // if it is not managed by MMTk, nothing needs to be done because the object does not need to be scanned - if (mmtk_object_is_managed_by_mmtk(ta->excstack)) { - process_slot(closure, &ta->excstack); - } - jl_excstack_t *excstack = ta->excstack; - size_t itr = ta->excstack->top; - size_t bt_index = 0; - size_t jlval_index = 0; - while (itr > 0) { - size_t bt_size = jl_excstack_bt_size(excstack, itr); - jl_bt_element_t *bt_data = jl_excstack_bt_data(excstack, itr); - for (; bt_index < bt_size; bt_index += jl_bt_entry_size(bt_data + bt_index)) { - jl_bt_element_t *bt_entry = bt_data + bt_index; - if (jl_bt_is_native(bt_entry)) - continue; - // Found an extended backtrace entry: iterate over any - // GC-managed values inside. - size_t njlvals = jl_bt_num_jlvals(bt_entry); - while (jlval_index < njlvals) { - jl_value_t** new_obj_slot = &bt_entry[2 + jlval_index].jlvalue; - jlval_index += 1; - process_slot(closure, new_obj_slot); - } - jlval_index = 0; - } - - jl_bt_element_t *stack_raw = (jl_bt_element_t *)(excstack+1); - jl_value_t** stack_obj_slot = &stack_raw[itr-1].jlvalue; - - itr = jl_excstack_next(excstack, itr); - bt_index = 0; - jlval_index = 0; - process_slot(closure, stack_obj_slot); - } - } -} - -// number of stacks to always keep available per pool - from gc-stacks.c -#define MIN_STACK_MAPPINGS_PER_POOL 5 - -#define jl_genericmemory_elsize(a) (((jl_datatype_t*)jl_typetagof(a))->layout->size) - -// if data is inlined inside the genericmemory object --- to->ptr needs to be updated when copying the array -void update_inlined_array(void* from, void* to) { - jl_value_t* jl_from = (jl_value_t*) from; - jl_value_t* jl_to = (jl_value_t*) to; - - uintptr_t tag_to = (uintptr_t)jl_typeof(jl_to); - jl_datatype_t *vt = (jl_datatype_t*)tag_to; - - if(vt->name == jl_genericmemory_typename) { - jl_genericmemory_t *a = (jl_genericmemory_t*)jl_from; - jl_genericmemory_t *b = (jl_genericmemory_t*)jl_to; - int how = jl_genericmemory_how(a); - - if (how == 0 && mmtk_object_is_managed_by_mmtk(a->ptr)) { // a is inlined (a->ptr points into the mmtk object) - size_t offset_of_data = ((size_t)a->ptr - (size_t)a); - if (offset_of_data > 0) { - b->ptr = (void*)((size_t) b + offset_of_data); - } - } - } -} - -// modified sweep_stack_pools from gc-stacks.c -void mmtk_sweep_stack_pools(void) -{ - // Stack sweeping algorithm: - // // deallocate stacks if we have too many sitting around unused - // for (stk in halfof(free_stacks)) - // free_stack(stk, pool_sz); - // // then sweep the task stacks - // for (t in live_tasks) - // if (!gc-marked(t)) - // stkbuf = t->stkbuf - // bufsz = t->bufsz - // if (stkbuf) - // push(free_stacks[sz], stkbuf) - assert(gc_n_threads); - for (int i = 0; i < jl_n_threads; i++) { - jl_ptls_t ptls2 = gc_all_tls_states[i]; - if (ptls2 == NULL) - continue; - - // free half of stacks that remain unused since last sweep - for (int p = 0; p < JL_N_STACK_POOLS; p++) { - small_arraylist_t *al = &ptls2->gc_tls_common.heap.free_stacks[p]; - size_t n_to_free; - if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) { - n_to_free = al->len; // not alive yet or dead, so it does not need these anymore - } - else if (al->len > MIN_STACK_MAPPINGS_PER_POOL) { - n_to_free = al->len / 2; - if (n_to_free > (al->len - MIN_STACK_MAPPINGS_PER_POOL)) - n_to_free = al->len - MIN_STACK_MAPPINGS_PER_POOL; - } - else { - n_to_free = 0; - } - for (int n = 0; n < n_to_free; n++) { - void *stk = small_arraylist_pop(al); - free_stack(stk, pool_sizes[p]); - } - if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) { - small_arraylist_free(al); - } - } - if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) { - small_arraylist_free(ptls2->gc_tls_common.heap.free_stacks); - } - - small_arraylist_t *live_tasks = &ptls2->gc_tls_common.heap.live_tasks; - size_t n = 0; - size_t ndel = 0; - size_t l = live_tasks->len; - void **lst = live_tasks->items; - if (l == 0) - continue; - while (1) { - jl_task_t *t = (jl_task_t*)lst[n]; - if (mmtk_is_live_object(t)) { - jl_task_t *maybe_forwarded = (jl_task_t*)mmtk_get_possibly_forwared(t); - live_tasks->items[n] = maybe_forwarded; - t = maybe_forwarded; - assert(jl_is_task(t)); - if (t->ctx.stkbuf == NULL) - ndel++; // jl_release_task_stack called - else - n++; - } else { - ndel++; - void *stkbuf = t->ctx.stkbuf; - size_t bufsz = t->ctx.bufsz; - if (stkbuf) { - t->ctx.stkbuf = NULL; - _jl_free_stack(ptls2, stkbuf, bufsz); - } -#ifdef _COMPILER_TSAN_ENABLED_ - if (t->ctx.tsan_state) { - __tsan_destroy_fiber(t->ctx.tsan_state); - t->ctx.tsan_state = NULL; - } -#endif - } - if (n >= l - ndel) - break; - void *tmp = lst[n]; - lst[n] = lst[n + ndel]; - lst[n + ndel] = tmp; - } - live_tasks->len -= ndel; - } -} - -JL_DLLEXPORT void* get_stackbase(int16_t tid) { - assert(tid >= 0); - jl_ptls_t ptls2 = jl_all_tls_states[tid]; - return ptls2->stackbase; -} - -const bool PRINT_OBJ_TYPE = false; - -void update_gc_stats(uint64_t inc, size_t mmtk_live_bytes, bool is_nursery_gc) { - gc_num.total_time += inc; - gc_num.pause += 1; - gc_num.full_sweep += !(is_nursery_gc); - gc_num.total_allocd += gc_num.allocd; - gc_num.allocd = 0; - live_bytes = mmtk_live_bytes; -} - -#define assert_size(ty_a, ty_b) \ - if(sizeof(ty_a) != sizeof(ty_b)) {\ - printf("%s size = %ld, %s size = %ld. Need to update our type definition.\n", #ty_a, sizeof(ty_a), #ty_b, sizeof(ty_b));\ - exit(1); \ - } - -#define PRINT_STRUCT_SIZE false -#define print_sizeof(type) (PRINT_STRUCT_SIZE ? (printf("C " #type " = %zu bytes\n", sizeof(type)), sizeof(type)) : sizeof(type)) - -#define jl_genericmemory_data_owner_field_addr(a) ((jl_value_t**)((jl_genericmemory_t*)(a) + 1)) - -void* jl_get_owner_address_to_mmtk(void* m) { - return (void*)jl_genericmemory_data_owner_field_addr(m); -} - -size_t mmtk_jl_genericmemory_how(void *arg) JL_NOTSAFEPOINT -{ - jl_genericmemory_t* m = (jl_genericmemory_t*)arg; - if (m->ptr == (void*)((char*)m + 16)) // JL_SMALL_BYTE_ALIGNMENT (from julia_internal.h) - return 0; - jl_value_t *owner = jl_genericmemory_data_owner_field(m); - if (owner == (jl_value_t*)m) - return 1; - if (owner == NULL) - return 2; - return 3; -} - - -uintptr_t get_abi_structs_checksum_c(void) { - assert_size(struct mmtk__jl_taggedvalue_bits, struct _jl_taggedvalue_bits); - assert_size(mmtk_jl_taggedvalue_t, jl_taggedvalue_t); - assert_size(mmtk_jl_datatype_layout_t, jl_datatype_layout_t); - assert_size(mmtk_jl_typename_t, jl_typename_t); - assert_size(mmtk_jl_svec_t, jl_svec_t); - assert_size(mmtk_jl_datatype_t, jl_datatype_t); - assert_size(mmtk_jl_array_t, jl_array_t); - assert_size(mmtk_jl_sym_t, jl_sym_t); - assert_size(mmtk_jl_binding_t, jl_binding_t); - assert_size(mmtk_htable_t, htable_t); - assert_size(mmtk_arraylist_t, arraylist_t); - assert_size(mmtk_jl_uuid_t, jl_uuid_t); - assert_size(mmtk_jl_mutex_t, jl_mutex_t); - assert_size(mmtk_jl_module_t, jl_module_t); - assert_size(mmtk_jl_excstack_t, jl_excstack_t); - assert_size(mmtk_jl_bt_element_t, jl_bt_element_t); - assert_size(mmtk_jl_stack_context_t, jl_stack_context_t); - assert_size(mmtk_jl_ucontext_t, jl_ucontext_t); - assert_size(struct mmtk__jl_gcframe_t, struct _jl_gcframe_t); - assert_size(mmtk_jl_task_t, jl_task_t); - assert_size(mmtk_jl_weakref_t, jl_weakref_t); - - return print_sizeof(MMTkMutatorContext) - ^ print_sizeof(struct mmtk__jl_taggedvalue_bits) - ^ print_sizeof(mmtk_jl_taggedvalue_t) - ^ print_sizeof(mmtk_jl_datatype_layout_t) - ^ print_sizeof(mmtk_jl_typename_t) - ^ print_sizeof(mmtk_jl_svec_t) - ^ print_sizeof(mmtk_jl_datatype_t) - ^ print_sizeof(mmtk_jl_array_t) - ^ print_sizeof(mmtk_jl_sym_t) - ^ print_sizeof(mmtk_jl_binding_t) - ^ print_sizeof(mmtk_htable_t) - ^ print_sizeof(mmtk_arraylist_t) - ^ print_sizeof(mmtk_jl_uuid_t) - ^ print_sizeof(mmtk_jl_mutex_t) - ^ print_sizeof(mmtk_jl_module_t) - ^ print_sizeof(mmtk_jl_excstack_t) - ^ print_sizeof(mmtk_jl_bt_element_t) - ^ print_sizeof(mmtk_jl_stack_context_t) - ^ print_sizeof(mmtk_jl_ucontext_t) - ^ print_sizeof(struct mmtk__jl_gcframe_t) - ^ print_sizeof(mmtk_jl_task_t) - ^ print_sizeof(mmtk_jl_weakref_t) - ^ print_sizeof(mmtk_jl_tls_states_t) - ^ print_sizeof(mmtk_jl_thread_heap_common_t) - ^ print_sizeof(mmtk_jl_thread_gc_num_common_t); -} - -Julia_Upcalls mmtk_upcalls = (Julia_Upcalls) { - .scan_julia_exc_obj = scan_julia_exc_obj, - .get_stackbase = get_stackbase, - .jl_throw_out_of_memory_error = jl_throw_out_of_memory_error, - .jl_get_gc_disable_counter = jl_get_gc_disable_counter, - .sweep_malloced_memory = mmtk_sweep_malloced_memory, - .sweep_stack_pools = mmtk_sweep_stack_pools, - .wait_in_a_safepoint = mmtk_wait_in_a_safepoint, - .exit_from_safepoint = mmtk_exit_from_safepoint, - .jl_hrtime = jl_hrtime, - .update_gc_stats = update_gc_stats, - .get_abi_structs_checksum_c = get_abi_structs_checksum_c, - .get_thread_finalizer_list = get_thread_finalizer_list, - .get_to_finalize_list = get_to_finalize_list, - .get_marked_finalizers_list = get_marked_finalizers_list, - .arraylist_grow = (void (*)(void*, long unsigned int))arraylist_grow, - .get_jl_gc_have_pending_finalizers = get_jl_gc_have_pending_finalizers, - .scan_vm_specific_roots = scan_vm_specific_roots, - .update_inlined_array = update_inlined_array, - .prepare_to_collect = jl_gc_prepare_to_collect, - .get_owner_address = jl_get_owner_address_to_mmtk, - .mmtk_genericmemory_how = mmtk_jl_genericmemory_how, -}; diff --git a/julia/mmtk_julia.h b/julia/mmtk_julia.h deleted file mode 100644 index 6c8c80d5..00000000 --- a/julia/mmtk_julia.h +++ /dev/null @@ -1,8 +0,0 @@ -#include "mmtk.h" -#include "gc-common.h" - -extern Julia_Upcalls mmtk_upcalls; - -int set_gc_running_state(jl_ptls_t ptls); -void mmtk_jl_gc_run_all_finalizers(void); -void mmtk_jl_run_pending_finalizers(void* tls); diff --git a/julia/mmtk_julia_types.h b/julia/mmtk_julia_types.h deleted file mode 100644 index 3bc7a03f..00000000 --- a/julia/mmtk_julia_types.h +++ /dev/null @@ -1,688 +0,0 @@ -// install bindgen with cargo install bindgen-cli -// run: -// BINDGEN_EXTRA_CLANG_ARGS="-I mmtk/api" ~/.cargo/bin/bindgen julia/mmtk_julia_types.h --opaque-type MMTkMutatorContext -o mmtk/src/julia_types.rs -- -x c++ -std=c++14 -#include -#include -#include -#include "mmtkMutator.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(_CPU_X86_64_) -# define _P64 -#elif defined(_CPU_X86_) -# define _P32 -#elif defined(_OS_WINDOWS_) -/* Not sure how to determine pointer size on Windows running ARM. */ -# if _WIN64 -# define _P64 -# else -# define _P32 -# endif -#elif __SIZEOF_POINTER__ == 8 -# define _P64 -#elif __SIZEOF_POINTER__ == 4 -# define _P32 -#else -# error pointer size not known for your platform / compiler -#endif - -typedef __SIZE_TYPE__ size_t; -typedef int sig_atomic_t; - -struct mmtk__jl_taggedvalue_bits { - uintptr_t gc:2; - uintptr_t in_image:1; - uintptr_t unused:1; -#ifdef _P64 - uintptr_t tag:60; -#else - uintptr_t tag:28; -#endif -}; - -typedef struct mmtk__jl_value_t mmtk_jl_value_t; -typedef struct mmtk__jl_taggedvalue_t mmtk_jl_taggedvalue_t; - -struct mmtk__jl_taggedvalue_t { - union { - uintptr_t header; - mmtk_jl_taggedvalue_t *next; - mmtk_jl_value_t *type; // 16-byte aligned - struct mmtk__jl_taggedvalue_bits bits; - }; - // jl_value_t value; -}; - -typedef struct { - uint32_t size; - uint32_t nfields; - uint32_t npointers; // number of pointers embedded inside - int32_t first_ptr; // index of the first pointer (or -1) - uint16_t alignment; // strictest alignment over all fields - struct { // combine these fields into a struct so that we can take addressof them - uint16_t haspadding : 1; // has internal undefined bytes - uint16_t fielddesc_type : 2; // 0 -> 8, 1 -> 16, 2 -> 32, 3 -> foreign type - // metadata bit only for GenericMemory eltype layout - uint16_t arrayelem_isboxed : 1; - uint16_t arrayelem_isunion : 1; - // If set, this type's egality can be determined entirely by comparing - // the non-padding bits of this datatype. - uint16_t isbitsegal : 1; - uint16_t padding : 10; - } flags; - // union { - // jl_fielddesc8_t field8[nfields]; - // jl_fielddesc16_t field16[nfields]; - // jl_fielddesc32_t field32[nfields]; - // }; - // union { // offsets relative to data start in words - // uint8_t ptr8[npointers]; - // uint16_t ptr16[npointers]; - // uint32_t ptr32[npointers]; - // }; -} mmtk_jl_datatype_layout_t; - -typedef struct { - void *name; - struct mmtk__jl_module_t *module; - void *names; // field names - const uint32_t *atomicfields; // if any fields are atomic, we record them here - const uint32_t *constfields; // if any fields are const, we record them here - // `wrapper` is either the only instantiation of the type (if no parameters) - // or a UnionAll accepting parameters to make an instantiation. - void *wrapper; - void *Typeofwrapper; - void *cache; // sorted array - void *linearcache; // unsorted array - void *mt; - void *partial; // incomplete instantiations of this type - intptr_t hash; - int32_t n_uninitialized; - // type properties - uint8_t abstract:1; - uint8_t mutabl:1; - uint8_t mayinlinealloc:1; - uint8_t _reserved:5; - uint8_t max_methods; -} mmtk_jl_typename_t; - -typedef struct { - size_t length; - // pointer size aligned - // jl_value_t *data[]; -} mmtk_jl_svec_t; - -typedef struct mmtk__jl_datatype_t { - mmtk_jl_typename_t *name; - struct mmtk__jl_datatype_t *super; - mmtk_jl_svec_t *parameters; - mmtk_jl_svec_t *types; - mmtk_jl_value_t *instance; // for singletons - const mmtk_jl_datatype_layout_t *layout; - // memoized properties - uint32_t hash; - uint16_t hasfreetypevars:1; // majority part of isconcrete computation - uint16_t isconcretetype:1; // whether this type can have instances - uint16_t isdispatchtuple:1; // aka isleaftupletype - uint16_t isbitstype:1; // relevant query for C-api and type-parameters - uint16_t zeroinit:1; // if one or more fields requires zero-initialization - uint16_t has_concrete_subtype:1; // If clear, no value will have this datatype - uint16_t maybe_subtype_of_cache:1; // Computational bit for has_concrete_supertype. See description in jltypes.c. - uint16_t isprimitivetype:1; // whether this is declared with 'primitive type' keyword (sized, no fields, and immutable) - uint16_t ismutationfree:1; // whether any mutable memory is reachable through this type (in the type or via fields) - uint16_t isidentityfree:1; // whether this type or any object reachable through its fields has non-content-based identity - uint16_t smalltag:6; // whether this type has a small-tag optimization -} mmtk_jl_datatype_t; - -typedef struct { - size_t length; - void *ptr; - // followed by padding and inline data, or owner pointer -#ifdef _P64 - // union { - // jl_value_t *owner; - // T inl[]; - // }; -#else - // - // jl_value_t *owner; - // size_t padding[1]; - // T inl[]; -#endif -} mmtk_jl_genericmemory_t; - - -typedef struct { - void *ptr_or_offset; - mmtk_jl_genericmemory_t *mem; -} mmtk_jl_genericmemoryref_t; - -typedef struct { - mmtk_jl_genericmemoryref_t ref; - size_t dimsize[]; // length for 1-D, otherwise length is mem->length -} mmtk_jl_array_t; - - -typedef struct mmtk__jl_sym_t { - _Atomic(void *) left; - _Atomic(void *) right; - uintptr_t hash; // precomputed hash value - // JL_ATTRIBUTE_ALIGN_PTRSIZE(char name[]); -} mmtk_jl_sym_t; - -#ifdef _P64 -// Union of a ptr and a 3 bit field. -typedef uintptr_t mmtk_jl_ptr_kind_union_t; -#else -typedef struct __attribute__((aligned(8))) { void *val; size_t kind; } mmtk_jl_ptr_kind_union_t; -#endif -typedef struct __attribute__((aligned(8))) mmtk__jl_binding_partition_t { - /* union { - * // For ->kind == BINDING_KIND_GLOBAL - * jl_value_t *type_restriction; - * // For ->kind == BINDING_KIND_CONST(_IMPORT) - * jl_value_t *constval; - * // For ->kind in (BINDING_KIND_IMPLICIT, BINDING_KIND_EXPLICIT, BINDING_KIND_IMPORT) - * jl_binding_t *imported; - * } restriction; - * - * Currently: Low 3 bits hold ->kind on _P64 to avoid needing >8 byte atomics - * - * This field is updated atomically with both kind and restriction. The following - * transitions are allowed and modeled by the system: - * - * GUARD -> any - * (DECLARED, FAILED) -> any non-GUARD - * IMPLICIT -> {EXPLICIT, IMPORTED} (->restriction unchanged only) - * - * In addition, we permit (with warning about undefined behavior) changing the restriction - * pointer for CONST(_IMPORT). - * - * All other kind or restriction transitions are disallowed. - */ - _Atomic(mmtk_jl_ptr_kind_union_t) restriction; - size_t min_world; - _Atomic(size_t) max_world; - _Atomic(struct mmtk__jl_binding_partition_t*) next; - size_t reserved; // Reserved for ->kind. Currently this holds the low bits of ->restriction during serialization -} mmtk_jl_binding_partition_t; - -typedef struct { - void *globalref; // cached GlobalRef for this binding - _Atomic(void*) value; - _Atomic(void*) partitions; - uint8_t declared:1; - uint8_t exportp:1; // `public foo` sets `publicp`, `export foo` sets both `publicp` and `exportp` - uint8_t publicp:1; // exportp without publicp is not allowed. - uint8_t deprecated:2; // 0=not deprecated, 1=renamed, 2=moved to another package - uint8_t padding:3; -} mmtk_jl_binding_t; - -#define HT_N_INLINE 32 - -typedef struct { - size_t size; - void **table; - void *_space[HT_N_INLINE]; -} mmtk_htable_t; - -#define AL_N_INLINE 29 - -typedef struct { - size_t len; - size_t max; - void **items; - void *_space[AL_N_INLINE]; -} mmtk_arraylist_t; - -#define SMALL_AL_N_INLINE 6 - -typedef struct { - uint32_t len; - uint32_t max; - void **items; - void *_space[SMALL_AL_N_INLINE]; -} mmtk_small_arraylist_t; - -typedef struct { - uint64_t hi; - uint64_t lo; -} mmtk_jl_uuid_t; - -typedef struct { - _Atomic(void*) owner; - uint32_t count; -} mmtk_jl_mutex_t; - -typedef struct mmtk__jl_module_t { - void *name; - struct mmtk__jl_module_t *parent; - _Atomic(mmtk_jl_svec_t)* bindings; - _Atomic(mmtk_jl_genericmemory_t)* bindingkeyset; // index lookup by name into bindings - void* file; - int32_t line; - // hidden fields: - mmtk_arraylist_t usings; // modules with all bindings potentially imported - mmtk_jl_uuid_t build_id; - mmtk_jl_uuid_t uuid; - _Atomic(uint32_t) counter; - int32_t nospecialize; // global bit flags: initialization for new methods - int8_t optlevel; - int8_t compile; - int8_t infer; - uint8_t istopmod; - int8_t max_methods; - mmtk_jl_mutex_t lock; - intptr_t hash; -} mmtk_jl_module_t; - -// Exception stack: a stack of pairs of (exception,raw_backtrace). -// The stack may be traversed and accessed with the functions below. -struct mmtk__jl_excstack_t { // typedef in julia.h - size_t top; - size_t reserved_size; - // Pack all stack entries into a growable buffer to amortize allocation - // across repeated exception handling. - // Layout: [bt_data1... bt_size1 exc1 bt_data2... bt_size2 exc2 ..] - // jl_bt_element_t data[]; // Access with jl_excstack_raw -}; - -typedef struct mmtk__jl_bt_element_t { - union { - uintptr_t uintptr; // Metadata or native instruction ptr - void* jlvalue; // Pointer to GC-managed value - }; -} mmtk_jl_bt_element_t; - -typedef struct mmtk__jl_excstack_t mmtk_jl_excstack_t; - -#ifdef __USE_POSIX -/* Use the same type for `jmp_buf' and `sigjmp_buf'. - The `__mask_was_saved' flag determines whether - or not `longjmp' will restore the signal mask. */ -// typedef struct __jmp_buf_tag sigjmp_buf[1]; - -/* Store the calling environment in ENV, also saving the - signal mask if SAVEMASK is nonzero. Return 0. */ -# define sigsetjmp(env, savemask) __sigsetjmp (env, savemask) - -/* Jump to the environment saved in ENV, making the - sigsetjmp call there return VAL, or 1 if VAL is 0. - Restore the signal mask if that sigsetjmp call saved it. - This is just an alias `longjmp'. */ -extern void siglongjmp (sigjmp_buf __env, int __val) - __THROWNL __attribute__ ((__noreturn__)); -#endif /* Use POSIX. */ - -# define mmtk_jl_jmp_buf sigjmp_buf - -typedef struct { - mmtk_jl_jmp_buf uc_mcontext; -} mmtk_jl_stack_context_t; - -typedef mmtk_jl_stack_context_t mmtk__jl_ucontext_t; - -typedef struct { - union { - mmtk__jl_ucontext_t *ctx; - mmtk_jl_stack_context_t *copy_ctx; - }; - void *stkbuf; // malloc'd memory (either copybuf or stack) - size_t bufsz; // actual sizeof stkbuf - unsigned int copy_stack:31; // sizeof stack for copybuf - unsigned int started:1; -#if defined(_COMPILER_TSAN_ENABLED_) - void *tsan_state; -#endif -#if defined(_COMPILER_ASAN_ENABLED_) - void *asan_fake_stack; -#endif -} mmtk_jl_ucontext_t; - -typedef struct mmtk__jl_gcframe_t mmtk_jl_gcframe_t; - -struct mmtk__jl_gcframe_t { - size_t nroots; - struct mmtk__jl_gcframe_t *prev; - // actual roots go here -}; - -typedef struct { - mmtk_jl_taggedvalue_t *freelist; // root of list of free objects - mmtk_jl_taggedvalue_t *newpages; // root of list of chunks of free objects - uint16_t osize; // size of objects in this pool -} mmtk_jl_gc_pool_t; - -typedef struct { - _Atomic(int64_t) allocd; - _Atomic(int64_t) pool_live_bytes; - _Atomic(uint64_t) malloc; - _Atomic(uint64_t) realloc; - _Atomic(uint64_t) poolalloc; - _Atomic(uint64_t) bigalloc; - _Atomic(int64_t) free_acc; - _Atomic(uint64_t) alloc_acc; -} mmtk_jl_thread_gc_num_common_t; - -typedef struct { - // variable for tracking weak references - mmtk_small_arraylist_t weak_refs; - // live tasks started on this thread - // that are holding onto a stack from the pool - mmtk_small_arraylist_t live_tasks; - - // variables for tracking malloc'd arrays - struct _mallocmemory_t *mallocarrays; - struct _mallocmemory_t *mafreelist; - -#define JL_N_STACK_POOLS 16 - mmtk_small_arraylist_t free_stacks[JL_N_STACK_POOLS]; -} mmtk_jl_thread_heap_common_t; - -// handle to reference an OS thread -typedef pthread_t mmtk_jl_thread_t; - -typedef struct { - alignas(64) _Atomic(int64_t) top; - alignas(64) _Atomic(int64_t) bottom; - alignas(64) _Atomic(void *) array; -} mmtk_ws_queue_t; - -typedef struct { - mmtk_ws_queue_t chunk_queue; - mmtk_ws_queue_t ptr_queue; - mmtk_arraylist_t reclaim_set; -} mmtk_jl_gc_markqueue_t; - - -typedef struct { - _Atomic(struct mmtk__jl_gc_pagemeta_t *) bottom; -} mmtk_jl_gc_page_stack_t; - - -typedef struct { - // thread local increment of `perm_scanned_bytes` - size_t perm_scanned_bytes; - // thread local increment of `scanned_bytes` - size_t scanned_bytes; - // Number of queued big objects (<= 1024) - size_t nbig_obj; - // Array of queued big objects to be moved between the young list - // and the old list. - // A set low bit means that the object should be moved from the old list - // to the young list (`mark_reset_age`). - // Objects can only be put into this list when the mark bit is flipped to - // `1` (atomically). Combining with the sync after marking, - // this makes sure that a single objects can only appear once in - // the lists (the mark bit cannot be flipped to `0` without sweeping) - void *big_obj[1024]; -} mmtk_jl_gc_mark_cache_t; - -typedef struct { - MMTkMutatorContext mmtk_mutator; - size_t malloc_sz_since_last_poll; -} mmtk_jl_gc_tls_states_t; - -typedef struct { - mmtk_jl_thread_heap_common_t heap; - mmtk_jl_thread_gc_num_common_t gc_num; -} mmtk_jl_gc_tls_states_common_t; - -typedef struct mmtk__jl_tls_states_t { - int16_t tid; - int8_t threadpoolid; - uint64_t rngseed; - _Atomic(volatile size_t *) safepoint; - _Atomic(int8_t) sleep_check_state; // read/write from foreign threads - // Whether it is safe to execute GC at the same time. -#define JL_GC_STATE_UNSAFE 0 - // gc_state = 0 means the thread is running Julia code and is not - // safe to run concurrently to the GC -#define JL_GC_STATE_WAITING 1 - // gc_state = 1 means the thread is doing GC or is waiting for the GC to - // finish. -#define JL_GC_STATE_SAFE 2 - // gc_state = 2 means the thread is running unmanaged code that can be - // execute at the same time with the GC. -#define JL_GC_PARALLEL_COLLECTOR_THREAD 3 - // gc_state = 3 means the thread is a parallel collector thread (i.e. never runs Julia code) -#define JL_GC_CONCURRENT_COLLECTOR_THREAD 4 - // gc_state = 4 means the thread is a concurrent collector thread (background sweeper thread that never runs Julia code) - _Atomic(int8_t) gc_state; // read from foreign threads - // execution of certain certain impure - // statements is prohibited from certain - // callbacks (such as generated functions) - // as it may make compilation undecidable - int16_t in_pure_callback; - int16_t in_finalizer; - int16_t disable_gc; - // Counter to disable finalizer **on the current thread** - int finalizers_inhibited; - mmtk_jl_gc_tls_states_t gc_tls; // this is very large, and the offset of the first member is baked into codegen - mmtk_jl_gc_tls_states_common_t gc_tls_common; // common tls for both GCs - volatile sig_atomic_t defer_signal; - _Atomic(struct mmtk__jl_task_t*) current_task; - struct mmtk__jl_task_t *next_task; - struct mmtk__jl_task_t *previous_task; - struct mmtk__jl_task_t *root_task; - void *timing_stack; - void *stackbase; - size_t stacksize; - // Temp storage for exception thrown in signal handler. Not rooted. - mmtk_jl_value_t *sig_exception; - // Temporary backtrace buffer. Scanned for gc roots when bt_size > 0. - struct mmtk__jl_bt_element_t *bt_data; // JL_MAX_BT_SIZE + 1 elements long - size_t bt_size; // Size for backtrace in transit in bt_data - // Temporary backtrace buffer used only for allocations profiler. - struct mmtk__jl_bt_element_t *profiling_bt_buffer; - // Atomically set by the sender, reset by the handler. - volatile _Atomic(sig_atomic_t) signal_request; // TODO: no actual reason for this to be _Atomic - // Allow the sigint to be raised asynchronously - // this is limited to the few places we do synchronous IO - // we can make this more general (similar to defer_signal) if necessary - volatile sig_atomic_t io_wait; - void *signal_stack; - size_t signal_stack_size; - mmtk_jl_thread_t system_id; - _Atomic(int16_t) suspend_count; - mmtk_arraylist_t finalizers; - // Saved exception for previous *external* API call or NULL if cleared. - // Access via jl_exception_occurred(). - struct _jl_value_t *previous_exception; - - // currently-held locks, to be released when an exception is thrown - mmtk_small_arraylist_t locks; - size_t engine_nqueued; - - // JULIA_DEBUG_SLEEPWAKE( - // uint64_t uv_run_enter; - // uint64_t uv_run_leave; - // uint64_t sleep_enter; - // uint64_t sleep_leave; - // ) - - // some hidden state (usually just because we don't have the type's size declaration) -} mmtk_jl_tls_states_t; - -#define JL_RNG_SIZE 5 // xoshiro 4 + splitmix 1 - -typedef struct mmtk__jl_task_t { - void *next; // invasive linked list for scheduler - void *queue; // invasive linked list for scheduler - void *tls; - void *donenotify; - void *result; - void *scope; - void *start; - uint64_t rngState[JL_RNG_SIZE]; - _Atomic(uint8_t) _state; - uint8_t sticky; // record whether this Task can be migrated to a new thread - _Atomic(uint8_t) _isexception; // set if `result` is an exception to throw or that we exited with - // multiqueue priority - uint16_t priority; - -// hidden state: - // id of owning thread - does not need to be defined until the task runs - _Atomic(int16_t) tid; - // threadpool id - int8_t threadpoolid; - // Reentrancy bits - // Bit 0: 1 if we are currently running inference/codegen - // Bit 1-2: 0-3 counter of how many times we've reentered inference - // Bit 3: 1 if we are writing the image and inference is illegal - uint8_t reentrant_timing; - // saved gc stack top for context switches - mmtk_jl_gcframe_t *gcstack; - size_t world_age; - // quick lookup for current ptls - void* ptls; // == jl_all_tls_states[tid] - // saved exception stack - mmtk_jl_excstack_t *excstack; - // current exception handler - void *eh; - // saved thread state - mmtk_jl_ucontext_t ctx; -} mmtk_jl_task_t; - -typedef struct { - mmtk_jl_value_t *value; -} mmtk_jl_weakref_t; - -// the following mirrors `struct EffectsOverride` in `base/compiler/effects.jl` -typedef union mmtk___jl_purity_overrides_t { - struct { - uint16_t ipo_consistent : 1; - uint16_t ipo_effect_free : 1; - uint16_t ipo_nothrow : 1; - uint16_t ipo_terminates_globally : 1; - // Weaker form of `terminates` that asserts - // that any control flow syntactically in the method - // is guaranteed to terminate, but does not make - // assertions about any called functions. - uint16_t ipo_terminates_locally : 1; - uint16_t ipo_notaskstate : 1; - uint16_t ipo_inaccessiblememonly : 1; - uint16_t ipo_noub : 1; - uint16_t ipo_noub_if_noinbounds : 1; - uint16_t ipo_consistent_overlay : 1; - } overrides; - uint16_t bits; -} mmtk__jl_purity_overrides_t; - -// This type describes a single method definition, and stores data -// shared by the specializations of a function. -typedef struct mmtk__jl_method_t { - void *name; // for error reporting - struct mmtk__jl_module_t *module; - void *file; - int32_t line; - size_t primary_world; - size_t deleted_world; - - // method's type signature. redundant with TypeMapEntry->specTypes - void *sig; - - // table of all jl_method_instance_t specializations we have - _Atomic(void*) specializations; // allocated as [hashable, ..., NULL, linear, ....], or a single item - _Atomic(void*) speckeyset; // index lookup by hash into specializations - - void *slot_syms; // compacted list of slot names (String) - void *external_mt; // reference to the method table this method is part of, null if part of the internal table - void *source; // original code template (jl_code_info_t, but may be compressed), null for builtins - void *debuginfo; // fixed linetable from the source argument, null if not available - _Atomic(void*) unspecialized; // unspecialized executable method instance, or null - void *generator; // executable code-generating function if available - void *roots; // pointers in generated code (shared to reduce memory), or null - // Identify roots by module-of-origin. We only track the module for roots added during incremental compilation. - // May be NULL if no external roots have been added, otherwise it's a Vector{UInt64} - void *root_blocks; // RLE (build_id.lo, offset) pairs (even/odd indexing) - int32_t nroots_sysimg; // # of roots stored in the system image - void *ccallable; // svec(rettype, sig) if a ccallable entry point is requested for this - - // cache of specializations of this method for invoke(), i.e. - // cases where this method was called even though it was not necessarily - // the most specific for the argument types. - _Atomic(void*) invokes; - - // A function that compares two specializations of this method, returning - // `true` if the first signature is to be considered "smaller" than the - // second for purposes of recursion analysis. Set to NULL to use - // the default recursion relation. - void *recursion_relation; - - uint32_t nargs; - uint32_t called; // bit flags: whether each of the first 8 arguments is called - uint32_t nospecialize; // bit flags: which arguments should not be specialized - uint32_t nkw; // # of leading arguments that are actually keyword arguments - // of another method. - // various boolean properties - uint8_t isva; - uint8_t is_for_opaque_closure; - - uint8_t nospecializeinfer; - // uint8 settings - uint8_t constprop; // 0x00 = use heuristic; 0x01 = aggressive; 0x02 = none - uint8_t max_varargs; // 0xFF = use heuristic; otherwise, max # of args to expand - // varargs when specializing. - - // Override the conclusions of inter-procedural effect analysis, - // forcing the conclusion to always true. - mmtk__jl_purity_overrides_t purity; - -// hidden fields: - // lock for modifications to the method - mmtk_jl_mutex_t writelock; -} mmtk_jl_method_t; - -#define JL_SMALL_TYPEOF(XX) \ - /* kinds */ \ - XX(typeofbottom) \ - XX(datatype) \ - XX(unionall) \ - XX(uniontype) \ - /* type parameter objects */ \ - XX(vararg) \ - XX(tvar) \ - XX(symbol) \ - XX(module) \ - /* special GC objects */ \ - XX(simplevector) \ - XX(string) \ - XX(task) \ - /* bits types with special allocators */ \ - XX(bool) \ - XX(char) \ - /*XX(float16)*/ \ - /*XX(float32)*/ \ - /*XX(float64)*/ \ - XX(int16) \ - XX(int32) \ - XX(int64) \ - XX(int8) \ - XX(uint16) \ - XX(uint32) \ - XX(uint64) \ - XX(uint8) \ - /* AST objects */ \ - /* XX(argument) */ \ - /* XX(newvarnode) */ \ - /* XX(slotnumber) */ \ - /* XX(ssavalue) */ \ - /* end of JL_SMALL_TYPEOF */ -enum mmtk_jl_small_typeof_tags { - mmtk_jl_null_tag = 0, -#define XX(name) mmtk_jl_##name##_tag, - JL_SMALL_TYPEOF(XX) -#undef XX - mmtk_jl_tags_count, - mmtk_jl_bitstags_first = mmtk_jl_char_tag, // n.b. bool is not considered a bitstype, since it can be compared by pointer - mmtk_jl_max_tags = 64 -}; - -#ifdef __cplusplus -} -#endif diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 8ec18b5e..598fecb3 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -112,6 +112,26 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.77", +] + [[package]] name = "bitflags" version = "2.6.0" @@ -164,6 +184,15 @@ dependencies = [ "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -184,6 +213,17 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "colorchoice" version = "1.0.2" @@ -340,6 +380,12 @@ dependencies = [ "url", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "heck" version = "0.5.0" @@ -465,6 +511,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets", +] + [[package]] name = "libz-sys" version = "1.1.20" @@ -508,6 +564,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "mmtk" version = "0.27.0" @@ -549,6 +611,7 @@ name = "mmtk-julia" version = "0.1.0" dependencies = [ "atomic 0.4.6", + "bindgen", "built", "cc", "chrono", @@ -572,6 +635,16 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "ntapi" version = "0.4.1" @@ -624,6 +697,16 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +[[package]] +name = "prettyplease" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +dependencies = [ + "proc-macro2", + "syn 2.0.77", +] + [[package]] name = "probe" version = "0.5.1" @@ -721,6 +804,12 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.4.1" diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 85821cc5..0acb9714 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "mmtk-julia" version = "0.1.0" -authors = ["Eduardo Souza "] +authors = ["Eduardo Souza ", "Yi Lin "] +build = "build.rs" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -10,7 +11,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/mmtk/julia.git" -julia_version = "d3f4808ffec79a2b9cac1cc26f90eec48741166b" +julia_version = "0517ff8d7981202989ef055296ad42c52a79b758" [lib] crate-type = ["cdylib"] @@ -18,6 +19,7 @@ crate-type = ["cdylib"] [build-dependencies] cc = "*" built = "*" +bindgen = "*" [profile.release] lto = true diff --git a/mmtk/api/mmtk.h b/mmtk/api/mmtk.h index 247b5e4a..30860b11 100644 --- a/mmtk/api/mmtk.h +++ b/mmtk/api/mmtk.h @@ -62,41 +62,10 @@ extern const void* MMTK_SIDE_LOG_BIT_BASE_ADDRESS; extern uintptr_t JULIA_MALLOC_BYTES; -/** - * Julia-specific - */ - -// When we call upcalls from Rust, we assume: -// * int is 4 bytes -// * size_t is 8 bytes -typedef struct { - void (* scan_julia_exc_obj) (void* obj, void* closure, ProcessSlotFn process_slot); - void* (* get_stackbase) (int16_t tid); - void (* jl_throw_out_of_memory_error) (void); - uint32_t (*jl_get_gc_disable_counter) (void); - void (* sweep_malloced_memory) (void); - void (* sweep_stack_pools) (void); - void (* wait_in_a_safepoint) (void); - void (* exit_from_safepoint) (int8_t old_state); - uint64_t (* jl_hrtime) (void); - void (* update_gc_stats) (uint64_t, size_t, bool); - uintptr_t (* get_abi_structs_checksum_c) (void); - void* (* get_thread_finalizer_list) (void* tls); - void* (* get_to_finalize_list)(void); - void* (* get_marked_finalizers_list)(void); - void (*arraylist_grow)(void* a, size_t n); - int* (*get_jl_gc_have_pending_finalizers)(void); - void (*scan_vm_specific_roots)(RootsWorkClosure* closure); - void (*update_inlined_array) (void* from, void* to); - void (*prepare_to_collect)(void); - void* (* get_owner_address)(void* m); - size_t (* mmtk_genericmemory_how)(void* m); -} Julia_Upcalls; - /** * Misc */ -extern void mmtk_gc_init(uintptr_t min_heap_size, uintptr_t max_heap_size, uintptr_t n_gcthreads, Julia_Upcalls *calls, uintptr_t header_size, uintptr_t tag); +extern void mmtk_gc_init(uintptr_t min_heap_size, uintptr_t max_heap_size, uintptr_t n_gcthreads, uintptr_t header_size, uintptr_t tag); extern bool mmtk_will_never_move(void* object); extern bool mmtk_process(char* name, char* value); extern void mmtk_scan_region(void); @@ -110,7 +79,12 @@ extern void mmtk_run_finalizers_for_obj(void* obj); extern void mmtk_run_finalizers(bool at_exit); extern void mmtk_gc_poll(void *tls); extern void mmtk_julia_copy_stack_check(int copy_stack); -extern void* mmtk_get_possibly_forwared(void* object); +extern void* mmtk_get_possibly_forwarded(void* object); +extern void mmtk_block_thread_for_gc(void); +extern void* mmtk_new_mutator_iterator(void); +extern void* mmtk_get_next_mutator_tls(void*); +extern void* mmtk_close_mutator_iterator(void*); + /** * VM Accounting diff --git a/mmtk/build.rs b/mmtk/build.rs new file mode 100644 index 00000000..3691c926 --- /dev/null +++ b/mmtk/build.rs @@ -0,0 +1,74 @@ +extern crate bindgen; + +// Use bindgen to build Rust bindings for Julia + +fn main() { + // Use environment variable $JULIA_PATH that points to Julia folder + let julia_dir_key = "JULIA_PATH"; + let mmtk_dir_key = "MMTK_JULIA_DIR"; + + let (mmtk_dir, julia_dir) = match (std::env::var(mmtk_dir_key), std::env::var(julia_dir_key)) { + (Ok(mmtk_val), Ok(julia_val)) => (mmtk_val, julia_val), + _ => panic!("Must set {} and {}", julia_dir_key, mmtk_dir_key), + }; + + // running `make julia_version.h` in $JULIA_PATH/src to generate julia_version.h + std::process::Command::new("make") + .current_dir(format!("{}/src", julia_dir)) + .args(["julia_version.h"]) + .output() + .expect("failed to execute process"); + + // runing `make` in $JULIA_PATH/deps to generate $JULIA_PATH/usr/include, in particular libunwind.h + std::process::Command::new("make") + .current_dir(format!("{}/deps", julia_dir)) + .output() + .expect("failed to execute process"); + + let bindings = bindgen::Builder::default() + .header(format!("{}/src/julia.h", julia_dir)) + .header(format!("{}/src/julia_internal.h", julia_dir)) + // Including the paths to depending .h files + .clang_arg("-I") + .clang_arg(format!("{}/mmtk/api", mmtk_dir)) + .clang_arg("-I") + .clang_arg(format!("{}/src", julia_dir)) + .clang_arg("-I") + .clang_arg(format!("{}/src/support", julia_dir)) + .clang_arg("-I") + .clang_arg(format!("{}/usr/include", julia_dir)) + // all types that we generate bindings from + .allowlist_item("jl_datatype_layout_t") + .allowlist_item("jl_ucontext_t") + .allowlist_item("jl_small_typeof_tags") + .allowlist_item("jl_*_tag") + .allowlist_item("jl_svec_t") + .allowlist_item("jl_module_t") + .allowlist_item("jl_task_t") + .allowlist_item("jl_datatype_t") + .allowlist_item("jl_weakref_t") + .allowlist_item("jl_binding_partition_t") + .allowlist_item("jl_bt_element_t") + .allowlist_item("jl_taggedvalue_t") + .allowlist_item("_jl_module_using") + .allowlist_item("MMTkMutatorContext") + // --opaque-type MMTkMutatorContext + .opaque_type("MMTkMutatorContext") + // compile using c++ + .clang_arg("-x") + .clang_arg("c++") + .clang_arg("-std=c++14") + // using MMTK types + .clang_arg("-DMMTK_GC") + // using Immix by default to define MMTK_NEEDS_WRITE_BARRIER + // but it shouldn't affect the resulting bindings file + .clang_arg("-DMMTK_PLAN_IMMIX") + // Finish the builder and generate the bindings. + .generate() + // Unwrap the Result and panic on failure. + .expect("Unable to generate bindings"); + + bindings + .write_to_file("src/julia_types.rs") + .expect("Couldn't write bindings!"); +} diff --git a/mmtk/src/active_plan.rs b/mmtk/src/active_plan.rs index dd704b7c..9c140caa 100644 --- a/mmtk/src/active_plan.rs +++ b/mmtk/src/active_plan.rs @@ -74,13 +74,15 @@ impl ActivePlan for VMActivePlan { // Expose the mutator iterator so they can be used in C. #[no_mangle] -pub extern "C" fn new_mutator_iterator() -> *mut JuliaMutatorIterator<'static> { +pub extern "C" fn mmtk_new_mutator_iterator() -> *mut JuliaMutatorIterator<'static> { let guard = MUTATORS.read().unwrap(); Box::into_raw(Box::new(JuliaMutatorIterator::new(guard))) } #[no_mangle] -pub extern "C" fn get_next_mutator_tls(iter: *mut JuliaMutatorIterator<'static>) -> OpaquePointer { +pub extern "C" fn mmtk_get_next_mutator_tls( + iter: *mut JuliaMutatorIterator<'static>, +) -> OpaquePointer { match unsafe { iter.as_mut() }.unwrap().next() { Some(m) => m.mutator_tls.0 .0, None => OpaquePointer::from_address(Address::ZERO), @@ -88,7 +90,7 @@ pub extern "C" fn get_next_mutator_tls(iter: *mut JuliaMutatorIterator<'static>) } #[no_mangle] -pub extern "C" fn close_mutator_iterator(iter: *mut JuliaMutatorIterator<'static>) { +pub extern "C" fn mmtk_close_mutator_iterator(iter: *mut JuliaMutatorIterator<'static>) { // The boxed pointer will get dropped let _to_drop = unsafe { Box::from_raw(iter) }; } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 9a6477ad..edfb770a 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -1,11 +1,8 @@ // All functions here are extern function. There is no point for marking them as unsafe. #![allow(clippy::not_unsafe_ptr_arg_deref)] - use crate::JuliaVM; -use crate::Julia_Upcalls; use crate::JULIA_HEADER_SIZE; use crate::SINGLETON; -use crate::UPCALLS; use crate::{BUILDER, DISABLED_GC, MUTATORS, USER_TRIGGERED_GC}; use libc::c_char; @@ -26,22 +23,14 @@ pub extern "C" fn mmtk_gc_init( min_heap_size: usize, max_heap_size: usize, n_gcthreads: usize, - calls: *const Julia_Upcalls, header_size: usize, buffer_tag: usize, ) { unsafe { - UPCALLS = calls; crate::JULIA_HEADER_SIZE = header_size; crate::JULIA_BUFF_TAG = buffer_tag; }; - // Assert to make sure our ABI is correct - assert_eq!( - unsafe { ((*UPCALLS).get_abi_structs_checksum_c)() }, - crate::util::get_abi_structs_checksum_rust() - ); - { let mut builder = BUILDER.lock().unwrap(); diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index 1fb6fa5b..45c219b0 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -1,5 +1,9 @@ +use crate::SINGLETON; +use crate::{ + jl_get_gc_disable_counter, jl_hrtime, jl_mmtk_prepare_to_collect, jl_mmtk_update_gc_stats, + jl_throw_out_of_memory_error, +}; use crate::{JuliaVM, USER_TRIGGERED_GC}; -use crate::{SINGLETON, UPCALLS}; use log::{info, trace}; use mmtk::util::alloc::AllocationError; use mmtk::util::opaque_pointer::*; @@ -36,18 +40,18 @@ impl Collection for VMCollection { } // Record the start time of the GC - let now = unsafe { ((*UPCALLS).jl_hrtime)() }; + let now = unsafe { jl_hrtime() }; trace!("gc_start = {}", now); GC_START.store(now, Ordering::Relaxed); } fn resume_mutators(_tls: VMWorkerThread) { // Get the end time of the GC - let end = unsafe { ((*UPCALLS).jl_hrtime)() }; + let end = unsafe { jl_hrtime() }; trace!("gc_end = {}", end); let gc_time = end - GC_START.load(Ordering::Relaxed); unsafe { - ((*UPCALLS).update_gc_stats)( + jl_mmtk_update_gc_stats( gc_time, crate::api::mmtk_used_bytes(), is_current_gc_nursery(), @@ -72,7 +76,7 @@ impl Collection for VMCollection { fn block_for_gc(_tls: VMMutatorThread) { info!("Triggered GC!"); - unsafe { ((*UPCALLS).prepare_to_collect)() }; + unsafe { jl_mmtk_prepare_to_collect() }; info!("Finished blocking mutator for GC!"); } @@ -97,7 +101,8 @@ impl Collection for VMCollection { fn out_of_memory(_tls: VMThread, _err_kind: AllocationError) { println!("Out of Memory!"); - unsafe { ((*UPCALLS).jl_throw_out_of_memory_error)() }; + unsafe { jl_throw_out_of_memory_error() }; + panic!("OOM!"); // Seeing if this is triggered by the LinearAlgebra tests } fn vm_live_bytes() -> usize { @@ -105,7 +110,7 @@ impl Collection for VMCollection { } fn is_collection_enabled() -> bool { - unsafe { ((*UPCALLS).jl_get_gc_disable_counter)() <= 0 } + unsafe { jl_get_gc_disable_counter() <= 0 } } } diff --git a/mmtk/src/julia_finalizer.rs b/mmtk/src/julia_finalizer.rs index 7d4dec03..f58e1115 100644 --- a/mmtk/src/julia_finalizer.rs +++ b/mmtk/src/julia_finalizer.rs @@ -1,4 +1,3 @@ -use crate::UPCALLS; use mmtk::memory_manager; use mmtk::util::Address; use mmtk::util::ObjectReference; @@ -8,13 +7,18 @@ use mmtk::Mutator; use crate::JuliaVM; +use crate::arraylist_grow; +use crate::jl_mmtk_get_have_pending_finalizers; +use crate::jl_mmtk_get_marked_finalizers_list; +use crate::jl_mmtk_get_thread_finalizer_list; +use crate::jl_mmtk_get_to_finalize_list; + /// This is a Rust implementation of finalizer scanning in _jl_gc_collect() in gc.c pub fn scan_finalizers_in_rust(tracer: &mut T) { use crate::mmtk::vm::ActivePlan; let to_finalize = ArrayListT::to_finalize_list(); let marked_finalizers_list = ArrayListT::marked_finalizers_list(); - let jl_gc_have_pending_finalizers: *mut i32 = - unsafe { ((*UPCALLS).get_jl_gc_have_pending_finalizers)() }; + let jl_gc_have_pending_finalizers: *mut i32 = unsafe { jl_mmtk_get_have_pending_finalizers() }; // Current length of marked list: we only need to trace objects after this length if this is a nursery GC. let mut orig_marked_len = marked_finalizers_list.len; @@ -72,17 +76,17 @@ impl ArrayListT { /// ptls->finalizers: new finalizers are registered into this thread local list fn thread_local_finalizer_list(mutator: &Mutator) -> &mut ArrayListT { - let list = unsafe { ((*UPCALLS).get_thread_finalizer_list)(mutator.mutator_tls.0 .0) }; + let list = unsafe { jl_mmtk_get_thread_finalizer_list(mutator.mutator_tls.0 .0) }; unsafe { &mut *list.to_mut_ptr() } } /// to_finalize: objects that are dead are in this list waiting for finalization fn to_finalize_list<'a>() -> &'a mut ArrayListT { - let list = unsafe { ((*UPCALLS).get_to_finalize_list)() }; + let list = unsafe { jl_mmtk_get_to_finalize_list() }; unsafe { &mut *list.to_mut_ptr() } } /// finalizer_list_marked: objects that are alive and traced, thus we do not need to scan them again in future nursery GCs. fn marked_finalizers_list<'a>() -> &'a mut ArrayListT { - let list = unsafe { ((*UPCALLS).get_marked_finalizers_list)() }; + let list = unsafe { jl_mmtk_get_marked_finalizers_list() }; unsafe { &mut *list.to_mut_ptr() } } @@ -103,7 +107,7 @@ impl ArrayListT { if newlen > self.max { // Call into C to grow the list. unsafe { - ((*UPCALLS).arraylist_grow)(Address::from_mut_ptr(self as _), n); + arraylist_grow(Address::from_mut_ptr(self as _), n); } } self.len = newlen diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index d87ac27f..8ce5a5d1 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -3,7 +3,6 @@ use crate::julia_types::*; use crate::slots::JuliaVMSlot; use crate::slots::OffsetSlot; use crate::JULIA_BUFF_TAG; -use crate::UPCALLS; use memoffset::offset_of; use mmtk::util::{Address, ObjectReference}; use mmtk::vm::slot::SimpleSlot; @@ -11,30 +10,35 @@ use mmtk::vm::SlotVisitor; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; +use crate::jl_mmtk_genericmemory_how; +use crate::jl_mmtk_get_owner_address; +use crate::jl_mmtk_get_stackbase; +use crate::jl_mmtk_scan_julia_exc_obj; + const JL_MAX_TAGS: usize = 64; // from vm/julia/src/jl_exports.h const OFFSET_OF_INLINED_SPACE_IN_MODULE: usize = - offset_of!(mmtk_jl_module_t, usings) + offset_of!(mmtk_arraylist_t, _space); + offset_of!(jl_module_t, usings) + offset_of!(arraylist_t, _space); #[allow(improper_ctypes)] extern "C" { - pub static jl_simplevector_type: *const mmtk_jl_datatype_t; - pub static jl_genericmemory_typename: *mut mmtk_jl_typename_t; - pub static jl_genericmemoryref_typename: *mut mmtk_jl_typename_t; - pub static jl_array_typename: *mut mmtk_jl_typename_t; - pub static jl_module_type: *const mmtk_jl_datatype_t; - pub static jl_task_type: *const mmtk_jl_datatype_t; - pub static jl_string_type: *const mmtk_jl_datatype_t; - pub static jl_weakref_type: *const mmtk_jl_datatype_t; - pub static jl_symbol_type: *const mmtk_jl_datatype_t; - pub static jl_method_type: *const mmtk_jl_datatype_t; - pub static jl_binding_partition_type: *const mmtk_jl_datatype_t; - pub static mut jl_small_typeof: [*mut mmtk_jl_datatype_t; 128usize]; + pub static jl_simplevector_type: *const jl_datatype_t; + pub static jl_genericmemory_typename: *mut jl_typename_t; + pub static jl_genericmemoryref_typename: *mut jl_typename_t; + pub static jl_array_typename: *mut jl_typename_t; + pub static jl_module_type: *const jl_datatype_t; + pub static jl_task_type: *const jl_datatype_t; + pub static jl_string_type: *const jl_datatype_t; + pub static jl_weakref_type: *const jl_datatype_t; + pub static jl_symbol_type: *const jl_datatype_t; + pub static jl_method_type: *const jl_datatype_t; + pub static jl_binding_partition_type: *const jl_datatype_t; + pub static mut jl_small_typeof: [*mut jl_datatype_t; 128usize]; } #[inline(always)] pub unsafe fn mmtk_jl_typetagof(addr: Address) -> Address { let as_tagged_value = - addr.as_usize() - std::mem::size_of::(); + addr.as_usize() - std::mem::size_of::(); let t_header = Address::from_usize(as_tagged_value).load::
(); let t = t_header.as_usize() & !0xf; @@ -42,18 +46,18 @@ pub unsafe fn mmtk_jl_typetagof(addr: Address) -> Address { } #[inline(always)] -pub unsafe fn mmtk_jl_typeof(addr: Address) -> *const mmtk_jl_datatype_t { +pub unsafe fn mmtk_jl_typeof(addr: Address) -> *const jl_datatype_t { mmtk_jl_to_typeof(mmtk_jl_typetagof(addr)) } #[inline(always)] -pub unsafe fn mmtk_jl_to_typeof(t: Address) -> *const mmtk_jl_datatype_t { +pub unsafe fn mmtk_jl_to_typeof(t: Address) -> *const jl_datatype_t { let t_raw = t.as_usize(); if t_raw < (JL_MAX_TAGS << 4) { let ty = jl_small_typeof[t_raw / std::mem::size_of::
()]; return ty; } - return t.to_ptr::(); + return t.to_ptr::(); } const PRINT_OBJ_TYPE: bool = false; @@ -76,23 +80,23 @@ pub unsafe fn scan_julia_object>(obj: Address, clos // symbols are always marked // buffers are marked by their parent object - if vtag.to_ptr::() == jl_symbol_type || vtag_usize == JULIA_BUFF_TAG { + if vtag.to_ptr::() == jl_symbol_type || vtag_usize == JULIA_BUFF_TAG { return; } - if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_unionall_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_uniontype_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_tvar_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_vararg_tag as usize) << 4) + if vtag_usize == ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_unionall_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_uniontype_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_tvar_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_vararg_tag as usize) << 4) { // these objects have pointers in them, but no other special handling // so we want these to fall through to the end vtag_usize = jl_small_typeof[vtag.as_usize() / std::mem::size_of::
()] as usize; vtag = Address::from_usize(vtag_usize); - } else if vtag_usize < ((mmtk_jl_small_typeof_tags_mmtk_jl_max_tags as usize) << 4) { + } else if vtag_usize < ((jl_small_typeof_tags_jl_max_tags as usize) << 4) { // these objects either have specialing handling - if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_simplevector_tag as usize) << 4) { + if vtag_usize == ((jl_small_typeof_tags_jl_simplevector_tag as usize) << 4) { if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: simple vector\n", obj); } @@ -104,12 +108,12 @@ pub unsafe fn scan_julia_object>(obj: Address, clos process_slot(closure, objary_begin); objary_begin = objary_begin.shift::
(1); } - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_module_tag as usize) << 4) { + } else if vtag_usize == ((jl_small_typeof_tags_jl_module_tag as usize) << 4) { if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: module\n", obj); } - let m = obj.to_ptr::(); + let m = obj.to_ptr::(); let bindings_slot = ::std::ptr::addr_of!((*m).bindings); if PRINT_OBJ_TYPE { println!(" - scan bindings: {:?}\n", bindings_slot); @@ -148,15 +152,15 @@ pub unsafe fn scan_julia_object>(obj: Address, clos println!(" - scan usings: {:?}\n", objary_begin); } process_slot(closure, objary_begin); - objary_begin = objary_begin.shift::
(1); + objary_begin = objary_begin.shift::
(3); } } - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_task_tag as usize) << 4) { + } else if vtag_usize == ((jl_small_typeof_tags_jl_task_tag as usize) << 4) { if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: task\n", obj); } - let ta = obj.to_ptr::(); + let ta = obj.to_ptr::(); mmtk_scan_gcstack(ta, closure); @@ -173,30 +177,30 @@ pub unsafe fn scan_julia_object>(obj: Address, clos process_slot(closure, slot); obj8_begin = obj8_begin.shift::(1); } - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_string_tag as usize) << 4) { + } else if vtag_usize == ((jl_small_typeof_tags_jl_string_tag as usize) << 4) { if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: string\n", obj); } } return; } else { - let vt = vtag.to_ptr::(); + let vt = vtag.to_ptr::(); let type_tag = mmtk_jl_typetagof(vtag); - if type_tag.as_usize() != ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4) + if type_tag.as_usize() != ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4) || (*vt).smalltag() != 0 { panic!( "GC error (probable corruption) - !jl_is_datatype(vt) = {}; vt->smalltag = {}, vt = {:?}", - vt as usize != ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4), - (*(vtag.to_ptr::())).smalltag() != 0, + vt as usize != ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4), + (*(vtag.to_ptr::())).smalltag() != 0, vt ); } } - let vt = vtag.to_ptr::(); + let vt = vtag.to_ptr::(); if (*vt).name == jl_array_typename { - let a = obj.to_ptr::(); + let a = obj.to_ptr::(); let memref = (*a).ref_; let ptr_or_offset = memref.ptr_or_offset; @@ -219,8 +223,8 @@ pub unsafe fn scan_julia_object>(obj: Address, clos if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: genericmemory\n", obj); } - let m = obj.to_ptr::(); - let how = mmtk_jl_genericmemory_how(m); + let m = obj.to_ptr::(); + let how = jl_mmtk_genericmemory_how(obj); if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: genericmemory how = {}\n", obj, how); @@ -310,11 +314,11 @@ pub unsafe fn scan_julia_object>(obj: Address, clos return; } else { if vt == jl_binding_partition_type { - let bpart_ptr = obj.to_mut_ptr::(); - let restriction = (*bpart_ptr).restriction; + let bpart_ptr = obj.to_mut_ptr::(); + let restriction = (*bpart_ptr).restriction._M_i; let offset = mmtk_decode_restriction_value(restriction); let slot = Address::from_ptr(::std::ptr::addr_of!((*bpart_ptr).restriction)); - if restriction as usize - offset != 0 { + if restriction - offset != 0 { process_offset_slot(closure, slot, offset); } } @@ -359,23 +363,9 @@ pub unsafe fn scan_julia_object>(obj: Address, clos } } -/* - how - allocation style - 0 = data is inlined - 1 = owns the gc-managed data, exclusively (will free it) - 2 = malloc-allocated pointer (does not own it) - 3 = has a pointer to the object that owns the data pointer -*/ -#[inline(always)] -pub unsafe fn mmtk_jl_genericmemory_how(m: *const mmtk_jl_genericmemory_t) -> usize { - return unsafe { ((*UPCALLS).mmtk_genericmemory_how)(Address::from_ptr(m)) }; -} - #[inline(always)] -unsafe fn mmtk_jl_genericmemory_data_owner_field_address( - m: *const mmtk_jl_genericmemory_t, -) -> Address { - unsafe { ((*UPCALLS).get_owner_address)(Address::from_ptr(m)) } +unsafe fn mmtk_jl_genericmemory_data_owner_field_address(m: *const jl_genericmemory_t) -> Address { + unsafe { jl_mmtk_get_owner_address(Address::from_ptr(m)) } } // #[inline(always)] @@ -386,7 +376,7 @@ unsafe fn mmtk_jl_genericmemory_data_owner_field_address( // } pub unsafe fn mmtk_scan_gcstack>( - ta: *const mmtk_jl_task_t, + ta: *const jl_task_t, closure: &mut EV, ) { let stkbuf = (*ta).ctx.stkbuf; @@ -403,10 +393,10 @@ pub unsafe fn mmtk_scan_gcstack>( #[cfg(feature = "julia_copy_stack")] if stkbuf != std::ptr::null_mut() && copy_stack != 0 && (*ta).ptls == std::ptr::null_mut() { - if ((*ta).tid as i16) < 0 { + if ((*ta).tid._M_i) < 0 { panic!("tid must be positive.") } - let stackbase = ((*UPCALLS).get_stackbase)((*ta).tid); + let stackbase = jl_mmtk_get_stackbase((*ta).tid._M_i); ub = stackbase as u64; lb = ub - ((*ta).ctx.copy_stack() as u64); offset = (*ta).ctx.stkbuf as isize - lb as isize; @@ -415,7 +405,7 @@ pub unsafe fn mmtk_scan_gcstack>( if s != std::ptr::null_mut() { let s_nroots_addr = ::std::ptr::addr_of!((*s).nroots); let mut nroots = read_stack(Address::from_ptr(s_nroots_addr), offset, lb, ub); - debug_assert!(nroots.as_usize() as u32 <= UINT32_MAX); + debug_assert!(nroots.as_usize() as u32 <= std::u32::MAX); let mut nr = nroots >> 2; loop { @@ -458,7 +448,7 @@ pub unsafe fn mmtk_scan_gcstack>( break; } - s = sprev.to_mut_ptr::(); + s = sprev.to_mut_ptr::(); let s_nroots_addr = ::std::ptr::addr_of!((*s).nroots); let new_nroots = read_stack(Address::from_ptr(s_nroots_addr), offset, lb, ub); nroots = new_nroots; @@ -469,7 +459,7 @@ pub unsafe fn mmtk_scan_gcstack>( // just call into C, since the code is cold if (*ta).excstack != std::ptr::null_mut() { - ((*UPCALLS).scan_julia_exc_obj)( + jl_mmtk_scan_julia_exc_obj( Address::from_ptr(ta), Address::from_mut_ptr(closure), process_slot:: as _, @@ -536,13 +526,13 @@ pub fn process_slot>(closure: &mut EV, slot: Addres // However, since MMTk uses the slot to load the object, we get the offset from pku using // that offset to pass to process_offset_edge and get the right address. #[inline(always)] -pub fn mmtk_decode_restriction_value(pku: u64) -> usize { +pub fn mmtk_decode_restriction_value(pku: usize) -> usize { #[cfg(target_pointer_width = "64")] { // need to apply (pku & ~0x7) to get the object to be traced // so we use (pku & 0x7) to get the offset from the object // and pass it to process_offset_slot - return pku as usize & 0x7; + return pku & 0x7; } #[cfg(not(target_pointer_width = "64"))] @@ -588,42 +578,42 @@ pub fn mmtk_jl_array_ndimwords(ndims: u32) -> usize { #[inline(always)] pub unsafe fn mmtk_jl_svec_len(obj: Address) -> usize { - (*obj.to_ptr::()).length + (*obj.to_ptr::()).length } #[inline(always)] pub unsafe fn mmtk_jl_svec_data(obj: Address) -> Address { - obj + std::mem::size_of::() + obj + std::mem::size_of::() } #[inline(always)] -pub unsafe fn mmtk_jl_tparam0(vt: *const mmtk_jl_datatype_t) -> *const mmtk_jl_datatype_t { +pub unsafe fn mmtk_jl_tparam0(vt: *const jl_datatype_t) -> *const jl_datatype_t { mmtk_jl_svecref((*vt).parameters, 0) } #[inline(always)] -pub unsafe fn mmtk_jl_svecref(vt: *mut mmtk_jl_svec_t, i: usize) -> *const mmtk_jl_datatype_t { +pub unsafe fn mmtk_jl_svecref(vt: *mut jl_svec_t, i: usize) -> *const jl_datatype_t { debug_assert!( mmtk_jl_typetagof(Address::from_mut_ptr(vt)).as_usize() - == (mmtk_jl_small_typeof_tags_mmtk_jl_simplevector_tag << 4) as usize + == (jl_small_typeof_tags_jl_simplevector_tag << 4) as usize ); debug_assert!(i < mmtk_jl_svec_len(Address::from_mut_ptr(vt))); let svec_data = mmtk_jl_svec_data(Address::from_mut_ptr(vt)); let result_ptr = svec_data + i; let result = result_ptr.atomic_load::(Ordering::Relaxed); - ::std::mem::transmute::(result) + ::std::mem::transmute::(result) } #[inline(always)] -pub unsafe fn mmtk_jl_dt_layout_ptrs(l: *const mmtk_jl_datatype_layout_t) -> Address { +pub unsafe fn mmtk_jl_dt_layout_ptrs(l: *const jl_datatype_layout_t) -> Address { mmtk_jl_dt_layout_fields(l) + (mmtk_jl_fielddesc_size((*l).fielddesc_type_custom()) * (*l).nfields) as usize } #[inline(always)] -pub unsafe fn mmtk_jl_dt_layout_fields(l: *const mmtk_jl_datatype_layout_t) -> Address { - Address::from_ptr(l) + std::mem::size_of::() +pub unsafe fn mmtk_jl_dt_layout_fields(l: *const jl_datatype_layout_t) -> Address { + Address::from_ptr(l) + std::mem::size_of::() } #[inline(always)] @@ -634,12 +624,12 @@ pub unsafe fn mmtk_jl_fielddesc_size(fielddesc_type: u16) -> u32 { const JL_BT_NON_PTR_ENTRY: usize = usize::MAX; -pub fn mmtk_jl_bt_is_native(bt_entry: *mut mmtk_jl_bt_element_t) -> bool { +pub fn mmtk_jl_bt_is_native(bt_entry: *mut jl_bt_element_t) -> bool { let entry = unsafe { (*bt_entry).__bindgen_anon_1.uintptr }; entry != JL_BT_NON_PTR_ENTRY } -pub fn mmtk_jl_bt_entry_size(bt_entry: *mut mmtk_jl_bt_element_t) -> usize { +pub fn mmtk_jl_bt_entry_size(bt_entry: *mut jl_bt_element_t) -> usize { if mmtk_jl_bt_is_native(bt_entry) { 1 } else { @@ -647,19 +637,19 @@ pub fn mmtk_jl_bt_entry_size(bt_entry: *mut mmtk_jl_bt_element_t) -> usize { } } -pub fn mmtk_jl_bt_num_jlvals(bt_entry: *mut mmtk_jl_bt_element_t) -> usize { +pub fn mmtk_jl_bt_num_jlvals(bt_entry: *mut jl_bt_element_t) -> usize { debug_assert!(!mmtk_jl_bt_is_native(bt_entry)); let entry = unsafe { (*bt_entry.add(1)).__bindgen_anon_1.uintptr }; entry & 0x7 } -pub fn mmtk_jl_bt_num_uintvals(bt_entry: *mut mmtk_jl_bt_element_t) -> usize { +pub fn mmtk_jl_bt_num_uintvals(bt_entry: *mut jl_bt_element_t) -> usize { debug_assert!(!mmtk_jl_bt_is_native(bt_entry)); let entry = unsafe { (*bt_entry.add(1)).__bindgen_anon_1.uintptr }; (entry >> 3) & 0x7 } -pub fn mmtk_jl_bt_entry_jlvalue(bt_entry: *mut mmtk_jl_bt_element_t, i: usize) -> ObjectReference { +pub fn mmtk_jl_bt_entry_jlvalue(bt_entry: *mut jl_bt_element_t, i: usize) -> ObjectReference { let entry = unsafe { (*bt_entry.add(2 + i)).__bindgen_anon_1.jlvalue }; debug_assert!(!entry.is_null()); unsafe { ObjectReference::from_raw_address_unchecked(Address::from_mut_ptr(entry)) } diff --git a/mmtk/src/julia_types.rs b/mmtk/src/julia_types.rs deleted file mode 100644 index e38d1831..00000000 --- a/mmtk/src/julia_types.rs +++ /dev/null @@ -1,4231 +0,0 @@ -/* automatically generated by rust-bindgen 0.70.1 */ - -#[repr(C)] -#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct __BindgenBitfieldUnit { - storage: Storage, -} -impl __BindgenBitfieldUnit { - #[inline] - pub const fn new(storage: Storage) -> Self { - Self { storage } - } -} -impl __BindgenBitfieldUnit -where - Storage: AsRef<[u8]> + AsMut<[u8]>, -{ - #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - byte & mask == mask - } - #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - if val { - *byte |= mask; - } else { - *byte &= !mask; - } - } - #[inline] - pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - let mut val = 0; - for i in 0..(bit_width as usize) { - if self.get_bit(i + bit_offset) { - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - val |= 1 << index; - } - } - val - } - #[inline] - pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - for i in 0..(bit_width as usize) { - let mask = 1 << i; - let val_bit_is_set = val & mask == mask; - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - self.set_bit(index + bit_offset, val_bit_is_set); - } - } -} -#[repr(C)] -#[derive(Default)] -pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); -impl __IncompleteArrayField { - #[inline] - pub const fn new() -> Self { - __IncompleteArrayField(::std::marker::PhantomData, []) - } - #[inline] - pub fn as_ptr(&self) -> *const T { - self as *const _ as *const T - } - #[inline] - pub fn as_mut_ptr(&mut self) -> *mut T { - self as *mut _ as *mut T - } - #[inline] - pub unsafe fn as_slice(&self, len: usize) -> &[T] { - ::std::slice::from_raw_parts(self.as_ptr(), len) - } - #[inline] - pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { - ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) - } -} -impl ::std::fmt::Debug for __IncompleteArrayField { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - fmt.write_str("__IncompleteArrayField") - } -} -pub const _SETJMP_H: u32 = 1; -pub const _FEATURES_H: u32 = 1; -pub const _ISOC95_SOURCE: u32 = 1; -pub const _ISOC99_SOURCE: u32 = 1; -pub const _ISOC11_SOURCE: u32 = 1; -pub const _ISOC2X_SOURCE: u32 = 1; -pub const _POSIX_SOURCE: u32 = 1; -pub const _POSIX_C_SOURCE: u32 = 200809; -pub const _XOPEN_SOURCE: u32 = 700; -pub const _XOPEN_SOURCE_EXTENDED: u32 = 1; -pub const _LARGEFILE64_SOURCE: u32 = 1; -pub const _DEFAULT_SOURCE: u32 = 1; -pub const _ATFILE_SOURCE: u32 = 1; -pub const _DYNAMIC_STACK_SIZE_SOURCE: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 1; -pub const __USE_ISOC11: u32 = 1; -pub const __USE_ISOC99: u32 = 1; -pub const __USE_ISOC95: u32 = 1; -pub const __USE_ISOCXX11: u32 = 1; -pub const __USE_POSIX: u32 = 1; -pub const __USE_POSIX2: u32 = 1; -pub const __USE_POSIX199309: u32 = 1; -pub const __USE_POSIX199506: u32 = 1; -pub const __USE_XOPEN2K: u32 = 1; -pub const __USE_XOPEN2K8: u32 = 1; -pub const __USE_XOPEN: u32 = 1; -pub const __USE_XOPEN_EXTENDED: u32 = 1; -pub const __USE_UNIX98: u32 = 1; -pub const _LARGEFILE_SOURCE: u32 = 1; -pub const __USE_XOPEN2K8XSI: u32 = 1; -pub const __USE_XOPEN2KXSI: u32 = 1; -pub const __USE_LARGEFILE: u32 = 1; -pub const __USE_LARGEFILE64: u32 = 1; -pub const __WORDSIZE: u32 = 64; -pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; -pub const __SYSCALL_WORDSIZE: u32 = 64; -pub const __TIMESIZE: u32 = 64; -pub const __USE_MISC: u32 = 1; -pub const __USE_ATFILE: u32 = 1; -pub const __USE_DYNAMIC_STACK_SIZE: u32 = 1; -pub const __USE_GNU: u32 = 1; -pub const __USE_FORTIFY_LEVEL: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; -pub const _STDC_PREDEF_H: u32 = 1; -pub const __STDC_IEC_559__: u32 = 1; -pub const __STDC_IEC_60559_BFP__: u32 = 201404; -pub const __STDC_IEC_559_COMPLEX__: u32 = 1; -pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404; -pub const __STDC_ISO_10646__: u32 = 201706; -pub const __GNU_LIBRARY__: u32 = 6; -pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 35; -pub const _SYS_CDEFS_H: u32 = 1; -pub const __glibc_c99_flexarr_available: u32 = 1; -pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; -pub const __HAVE_GENERIC_SELECTION: u32 = 0; -pub const _BITS_SETJMP_H: u32 = 1; -pub const __jmp_buf_tag_defined: u32 = 1; -pub const _STDINT_H: u32 = 1; -pub const __GLIBC_USE_LIB_EXT2: u32 = 1; -pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 1; -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 1; -pub const __GLIBC_USE_IEC_60559_EXT: u32 = 1; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 1; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 1; -pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 1; -pub const _BITS_TYPES_H: u32 = 1; -pub const _BITS_TYPESIZES_H: u32 = 1; -pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; -pub const __INO_T_MATCHES_INO64_T: u32 = 1; -pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; -pub const __STATFS_MATCHES_STATFS64: u32 = 1; -pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1; -pub const __FD_SETSIZE: u32 = 1024; -pub const _BITS_TIME64_H: u32 = 1; -pub const _BITS_WCHAR_H: u32 = 1; -pub const _BITS_STDINT_INTN_H: u32 = 1; -pub const _BITS_STDINT_UINTN_H: u32 = 1; -pub const INT8_MIN: i32 = -128; -pub const INT16_MIN: i32 = -32768; -pub const INT32_MIN: i32 = -2147483648; -pub const INT8_MAX: u32 = 127; -pub const INT16_MAX: u32 = 32767; -pub const INT32_MAX: u32 = 2147483647; -pub const UINT8_MAX: u32 = 255; -pub const UINT16_MAX: u32 = 65535; -pub const UINT32_MAX: u32 = 4294967295; -pub const INT_LEAST8_MIN: i32 = -128; -pub const INT_LEAST16_MIN: i32 = -32768; -pub const INT_LEAST32_MIN: i32 = -2147483648; -pub const INT_LEAST8_MAX: u32 = 127; -pub const INT_LEAST16_MAX: u32 = 32767; -pub const INT_LEAST32_MAX: u32 = 2147483647; -pub const UINT_LEAST8_MAX: u32 = 255; -pub const UINT_LEAST16_MAX: u32 = 65535; -pub const UINT_LEAST32_MAX: u32 = 4294967295; -pub const INT_FAST8_MIN: i32 = -128; -pub const INT_FAST16_MIN: i64 = -9223372036854775808; -pub const INT_FAST32_MIN: i64 = -9223372036854775808; -pub const INT_FAST8_MAX: u32 = 127; -pub const INT_FAST16_MAX: u64 = 9223372036854775807; -pub const INT_FAST32_MAX: u64 = 9223372036854775807; -pub const UINT_FAST8_MAX: u32 = 255; -pub const UINT_FAST16_MAX: i32 = -1; -pub const UINT_FAST32_MAX: i32 = -1; -pub const INTPTR_MIN: i64 = -9223372036854775808; -pub const INTPTR_MAX: u64 = 9223372036854775807; -pub const UINTPTR_MAX: i32 = -1; -pub const PTRDIFF_MIN: i64 = -9223372036854775808; -pub const PTRDIFF_MAX: u64 = 9223372036854775807; -pub const SIG_ATOMIC_MIN: i32 = -2147483648; -pub const SIG_ATOMIC_MAX: u32 = 2147483647; -pub const SIZE_MAX: i32 = -1; -pub const WINT_MIN: u32 = 0; -pub const WINT_MAX: u32 = 4294967295; -pub const INT8_WIDTH: u32 = 8; -pub const UINT8_WIDTH: u32 = 8; -pub const INT16_WIDTH: u32 = 16; -pub const UINT16_WIDTH: u32 = 16; -pub const INT32_WIDTH: u32 = 32; -pub const UINT32_WIDTH: u32 = 32; -pub const INT64_WIDTH: u32 = 64; -pub const UINT64_WIDTH: u32 = 64; -pub const INT_LEAST8_WIDTH: u32 = 8; -pub const UINT_LEAST8_WIDTH: u32 = 8; -pub const INT_LEAST16_WIDTH: u32 = 16; -pub const UINT_LEAST16_WIDTH: u32 = 16; -pub const INT_LEAST32_WIDTH: u32 = 32; -pub const UINT_LEAST32_WIDTH: u32 = 32; -pub const INT_LEAST64_WIDTH: u32 = 64; -pub const UINT_LEAST64_WIDTH: u32 = 64; -pub const INT_FAST8_WIDTH: u32 = 8; -pub const UINT_FAST8_WIDTH: u32 = 8; -pub const INT_FAST16_WIDTH: u32 = 64; -pub const UINT_FAST16_WIDTH: u32 = 64; -pub const INT_FAST32_WIDTH: u32 = 64; -pub const UINT_FAST32_WIDTH: u32 = 64; -pub const INT_FAST64_WIDTH: u32 = 64; -pub const UINT_FAST64_WIDTH: u32 = 64; -pub const INTPTR_WIDTH: u32 = 64; -pub const UINTPTR_WIDTH: u32 = 64; -pub const INTMAX_WIDTH: u32 = 64; -pub const UINTMAX_WIDTH: u32 = 64; -pub const PTRDIFF_WIDTH: u32 = 64; -pub const SIG_ATOMIC_WIDTH: u32 = 32; -pub const SIZE_WIDTH: u32 = 64; -pub const WCHAR_WIDTH: u32 = 32; -pub const WINT_WIDTH: u32 = 32; -pub const _PTHREAD_H: u32 = 1; -pub const _SCHED_H: u32 = 1; -pub const __time_t_defined: u32 = 1; -pub const _STRUCT_TIMESPEC: u32 = 1; -pub const _BITS_ENDIAN_H: u32 = 1; -pub const __LITTLE_ENDIAN: u32 = 1234; -pub const __BIG_ENDIAN: u32 = 4321; -pub const __PDP_ENDIAN: u32 = 3412; -pub const _BITS_ENDIANNESS_H: u32 = 1; -pub const __BYTE_ORDER: u32 = 1234; -pub const __FLOAT_WORD_ORDER: u32 = 1234; -pub const _BITS_SCHED_H: u32 = 1; -pub const SCHED_OTHER: u32 = 0; -pub const SCHED_FIFO: u32 = 1; -pub const SCHED_RR: u32 = 2; -pub const SCHED_BATCH: u32 = 3; -pub const SCHED_ISO: u32 = 4; -pub const SCHED_IDLE: u32 = 5; -pub const SCHED_DEADLINE: u32 = 6; -pub const SCHED_RESET_ON_FORK: u32 = 1073741824; -pub const CSIGNAL: u32 = 255; -pub const CLONE_VM: u32 = 256; -pub const CLONE_FS: u32 = 512; -pub const CLONE_FILES: u32 = 1024; -pub const CLONE_SIGHAND: u32 = 2048; -pub const CLONE_PIDFD: u32 = 4096; -pub const CLONE_PTRACE: u32 = 8192; -pub const CLONE_VFORK: u32 = 16384; -pub const CLONE_PARENT: u32 = 32768; -pub const CLONE_THREAD: u32 = 65536; -pub const CLONE_NEWNS: u32 = 131072; -pub const CLONE_SYSVSEM: u32 = 262144; -pub const CLONE_SETTLS: u32 = 524288; -pub const CLONE_PARENT_SETTID: u32 = 1048576; -pub const CLONE_CHILD_CLEARTID: u32 = 2097152; -pub const CLONE_DETACHED: u32 = 4194304; -pub const CLONE_UNTRACED: u32 = 8388608; -pub const CLONE_CHILD_SETTID: u32 = 16777216; -pub const CLONE_NEWCGROUP: u32 = 33554432; -pub const CLONE_NEWUTS: u32 = 67108864; -pub const CLONE_NEWIPC: u32 = 134217728; -pub const CLONE_NEWUSER: u32 = 268435456; -pub const CLONE_NEWPID: u32 = 536870912; -pub const CLONE_NEWNET: u32 = 1073741824; -pub const CLONE_IO: u32 = 2147483648; -pub const _BITS_TYPES_STRUCT_SCHED_PARAM: u32 = 1; -pub const _BITS_CPU_SET_H: u32 = 1; -pub const __CPU_SETSIZE: u32 = 1024; -pub const CPU_SETSIZE: u32 = 1024; -pub const _TIME_H: u32 = 1; -pub const _BITS_TIME_H: u32 = 1; -pub const CLOCK_REALTIME: u32 = 0; -pub const CLOCK_MONOTONIC: u32 = 1; -pub const CLOCK_PROCESS_CPUTIME_ID: u32 = 2; -pub const CLOCK_THREAD_CPUTIME_ID: u32 = 3; -pub const CLOCK_MONOTONIC_RAW: u32 = 4; -pub const CLOCK_REALTIME_COARSE: u32 = 5; -pub const CLOCK_MONOTONIC_COARSE: u32 = 6; -pub const CLOCK_BOOTTIME: u32 = 7; -pub const CLOCK_REALTIME_ALARM: u32 = 8; -pub const CLOCK_BOOTTIME_ALARM: u32 = 9; -pub const CLOCK_TAI: u32 = 11; -pub const TIMER_ABSTIME: u32 = 1; -pub const _BITS_TIMEX_H: u32 = 1; -pub const __timeval_defined: u32 = 1; -pub const ADJ_OFFSET: u32 = 1; -pub const ADJ_FREQUENCY: u32 = 2; -pub const ADJ_MAXERROR: u32 = 4; -pub const ADJ_ESTERROR: u32 = 8; -pub const ADJ_STATUS: u32 = 16; -pub const ADJ_TIMECONST: u32 = 32; -pub const ADJ_TAI: u32 = 128; -pub const ADJ_SETOFFSET: u32 = 256; -pub const ADJ_MICRO: u32 = 4096; -pub const ADJ_NANO: u32 = 8192; -pub const ADJ_TICK: u32 = 16384; -pub const ADJ_OFFSET_SINGLESHOT: u32 = 32769; -pub const ADJ_OFFSET_SS_READ: u32 = 40961; -pub const MOD_OFFSET: u32 = 1; -pub const MOD_FREQUENCY: u32 = 2; -pub const MOD_MAXERROR: u32 = 4; -pub const MOD_ESTERROR: u32 = 8; -pub const MOD_STATUS: u32 = 16; -pub const MOD_TIMECONST: u32 = 32; -pub const MOD_CLKB: u32 = 16384; -pub const MOD_CLKA: u32 = 32769; -pub const MOD_TAI: u32 = 128; -pub const MOD_MICRO: u32 = 4096; -pub const MOD_NANO: u32 = 8192; -pub const STA_PLL: u32 = 1; -pub const STA_PPSFREQ: u32 = 2; -pub const STA_PPSTIME: u32 = 4; -pub const STA_FLL: u32 = 8; -pub const STA_INS: u32 = 16; -pub const STA_DEL: u32 = 32; -pub const STA_UNSYNC: u32 = 64; -pub const STA_FREQHOLD: u32 = 128; -pub const STA_PPSSIGNAL: u32 = 256; -pub const STA_PPSJITTER: u32 = 512; -pub const STA_PPSWANDER: u32 = 1024; -pub const STA_PPSERROR: u32 = 2048; -pub const STA_CLOCKERR: u32 = 4096; -pub const STA_NANO: u32 = 8192; -pub const STA_MODE: u32 = 16384; -pub const STA_CLK: u32 = 32768; -pub const STA_RONLY: u32 = 65280; -pub const __clock_t_defined: u32 = 1; -pub const __struct_tm_defined: u32 = 1; -pub const __clockid_t_defined: u32 = 1; -pub const __timer_t_defined: u32 = 1; -pub const __itimerspec_defined: u32 = 1; -pub const _BITS_TYPES_LOCALE_T_H: u32 = 1; -pub const _BITS_TYPES___LOCALE_T_H: u32 = 1; -pub const TIME_UTC: u32 = 1; -pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; -pub const _THREAD_SHARED_TYPES_H: u32 = 1; -pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; -pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; -pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; -pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; -pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; -pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; -pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; -pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; -pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1; -pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; -pub const __have_pthread_attr_t: u32 = 1; -pub const __SC_THREAD_STACK_MIN_VALUE: u32 = 75; -pub const PTHREAD_ONCE_INIT: u32 = 0; -pub const PTHREAD_BARRIER_SERIAL_THREAD: i32 = -1; -pub const PTHREAD_ATTR_NO_SIGMASK_NP: i32 = -1; -pub const MAX_BUMP_ALLOCATORS: u32 = 6; -pub const MAX_LARGE_OBJECT_ALLOCATORS: u32 = 2; -pub const MAX_MALLOC_ALLOCATORS: u32 = 1; -pub const MAX_IMMIX_ALLOCATORS: u32 = 1; -pub const MAX_FREE_LIST_ALLOCATORS: u32 = 2; -pub const MAX_MARK_COMPACT_ALLOCATORS: u32 = 1; -pub const __alignas_is_defined: u32 = 1; -pub const __alignof_is_defined: u32 = 1; -pub const HT_N_INLINE: u32 = 32; -pub const AL_N_INLINE: u32 = 29; -pub const SMALL_AL_N_INLINE: u32 = 6; -pub const JL_N_STACK_POOLS: u32 = 16; -pub const JL_GC_STATE_UNSAFE: u32 = 0; -pub const JL_GC_STATE_WAITING: u32 = 1; -pub const JL_GC_STATE_SAFE: u32 = 2; -pub const JL_GC_PARALLEL_COLLECTOR_THREAD: u32 = 3; -pub const JL_GC_CONCURRENT_COLLECTOR_THREAD: u32 = 4; -pub const JL_RNG_SIZE: u32 = 5; -pub type __jmp_buf = [::std::os::raw::c_long; 8usize]; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sigset_t { - pub __val: [::std::os::raw::c_ulong; 16usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __sigset_t"][::std::mem::size_of::<__sigset_t>() - 128usize]; - ["Alignment of __sigset_t"][::std::mem::align_of::<__sigset_t>() - 8usize]; - ["Offset of field: __sigset_t::__val"][::std::mem::offset_of!(__sigset_t, __val) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __jmp_buf_tag { - pub __jmpbuf: __jmp_buf, - pub __mask_was_saved: ::std::os::raw::c_int, - pub __saved_mask: __sigset_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __jmp_buf_tag"][::std::mem::size_of::<__jmp_buf_tag>() - 200usize]; - ["Alignment of __jmp_buf_tag"][::std::mem::align_of::<__jmp_buf_tag>() - 8usize]; - ["Offset of field: __jmp_buf_tag::__jmpbuf"] - [::std::mem::offset_of!(__jmp_buf_tag, __jmpbuf) - 0usize]; - ["Offset of field: __jmp_buf_tag::__mask_was_saved"] - [::std::mem::offset_of!(__jmp_buf_tag, __mask_was_saved) - 64usize]; - ["Offset of field: __jmp_buf_tag::__saved_mask"] - [::std::mem::offset_of!(__jmp_buf_tag, __saved_mask) - 72usize]; -}; -pub type jmp_buf = [__jmp_buf_tag; 1usize]; -extern "C" { - pub fn setjmp(__env: *mut __jmp_buf_tag) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __sigsetjmp( - __env: *mut __jmp_buf_tag, - __savemask: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _setjmp(__env: *mut __jmp_buf_tag) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn longjmp(__env: *mut __jmp_buf_tag, __val: ::std::os::raw::c_int) -> !; -} -extern "C" { - pub fn _longjmp(__env: *mut __jmp_buf_tag, __val: ::std::os::raw::c_int) -> !; -} -pub type sigjmp_buf = [__jmp_buf_tag; 1usize]; -extern "C" { - pub fn siglongjmp(__env: *mut __jmp_buf_tag, __val: ::std::os::raw::c_int) -> !; -} -pub type __u_char = ::std::os::raw::c_uchar; -pub type __u_short = ::std::os::raw::c_ushort; -pub type __u_int = ::std::os::raw::c_uint; -pub type __u_long = ::std::os::raw::c_ulong; -pub type __int8_t = ::std::os::raw::c_schar; -pub type __uint8_t = ::std::os::raw::c_uchar; -pub type __int16_t = ::std::os::raw::c_short; -pub type __uint16_t = ::std::os::raw::c_ushort; -pub type __int32_t = ::std::os::raw::c_int; -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __int64_t = ::std::os::raw::c_long; -pub type __uint64_t = ::std::os::raw::c_ulong; -pub type __int_least8_t = __int8_t; -pub type __uint_least8_t = __uint8_t; -pub type __int_least16_t = __int16_t; -pub type __uint_least16_t = __uint16_t; -pub type __int_least32_t = __int32_t; -pub type __uint_least32_t = __uint32_t; -pub type __int_least64_t = __int64_t; -pub type __uint_least64_t = __uint64_t; -pub type __quad_t = ::std::os::raw::c_long; -pub type __u_quad_t = ::std::os::raw::c_ulong; -pub type __intmax_t = ::std::os::raw::c_long; -pub type __uintmax_t = ::std::os::raw::c_ulong; -pub type __dev_t = ::std::os::raw::c_ulong; -pub type __uid_t = ::std::os::raw::c_uint; -pub type __gid_t = ::std::os::raw::c_uint; -pub type __ino_t = ::std::os::raw::c_ulong; -pub type __ino64_t = ::std::os::raw::c_ulong; -pub type __mode_t = ::std::os::raw::c_uint; -pub type __nlink_t = ::std::os::raw::c_ulong; -pub type __off_t = ::std::os::raw::c_long; -pub type __off64_t = ::std::os::raw::c_long; -pub type __pid_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __fsid_t { - pub __val: [::std::os::raw::c_int; 2usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __fsid_t"][::std::mem::size_of::<__fsid_t>() - 8usize]; - ["Alignment of __fsid_t"][::std::mem::align_of::<__fsid_t>() - 4usize]; - ["Offset of field: __fsid_t::__val"][::std::mem::offset_of!(__fsid_t, __val) - 0usize]; -}; -pub type __clock_t = ::std::os::raw::c_long; -pub type __rlim_t = ::std::os::raw::c_ulong; -pub type __rlim64_t = ::std::os::raw::c_ulong; -pub type __id_t = ::std::os::raw::c_uint; -pub type __time_t = ::std::os::raw::c_long; -pub type __useconds_t = ::std::os::raw::c_uint; -pub type __suseconds_t = ::std::os::raw::c_long; -pub type __suseconds64_t = ::std::os::raw::c_long; -pub type __daddr_t = ::std::os::raw::c_int; -pub type __key_t = ::std::os::raw::c_int; -pub type __clockid_t = ::std::os::raw::c_int; -pub type __timer_t = *mut ::std::os::raw::c_void; -pub type __blksize_t = ::std::os::raw::c_long; -pub type __blkcnt_t = ::std::os::raw::c_long; -pub type __blkcnt64_t = ::std::os::raw::c_long; -pub type __fsblkcnt_t = ::std::os::raw::c_ulong; -pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; -pub type __fsword_t = ::std::os::raw::c_long; -pub type __ssize_t = ::std::os::raw::c_long; -pub type __syscall_slong_t = ::std::os::raw::c_long; -pub type __syscall_ulong_t = ::std::os::raw::c_ulong; -pub type __loff_t = __off64_t; -pub type __caddr_t = *mut ::std::os::raw::c_char; -pub type __intptr_t = ::std::os::raw::c_long; -pub type __socklen_t = ::std::os::raw::c_uint; -pub type __sig_atomic_t = ::std::os::raw::c_int; -pub type int_least8_t = __int_least8_t; -pub type int_least16_t = __int_least16_t; -pub type int_least32_t = __int_least32_t; -pub type int_least64_t = __int_least64_t; -pub type uint_least8_t = __uint_least8_t; -pub type uint_least16_t = __uint_least16_t; -pub type uint_least32_t = __uint_least32_t; -pub type uint_least64_t = __uint_least64_t; -pub type int_fast8_t = ::std::os::raw::c_schar; -pub type int_fast16_t = ::std::os::raw::c_long; -pub type int_fast32_t = ::std::os::raw::c_long; -pub type int_fast64_t = ::std::os::raw::c_long; -pub type uint_fast8_t = ::std::os::raw::c_uchar; -pub type uint_fast16_t = ::std::os::raw::c_ulong; -pub type uint_fast32_t = ::std::os::raw::c_ulong; -pub type uint_fast64_t = ::std::os::raw::c_ulong; -pub type intmax_t = __intmax_t; -pub type uintmax_t = __uintmax_t; -pub type time_t = __time_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timespec { - pub tv_sec: __time_t, - pub tv_nsec: __syscall_slong_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of timespec"][::std::mem::size_of::() - 16usize]; - ["Alignment of timespec"][::std::mem::align_of::() - 8usize]; - ["Offset of field: timespec::tv_sec"][::std::mem::offset_of!(timespec, tv_sec) - 0usize]; - ["Offset of field: timespec::tv_nsec"][::std::mem::offset_of!(timespec, tv_nsec) - 8usize]; -}; -pub type pid_t = __pid_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sched_param { - pub sched_priority: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of sched_param"][::std::mem::size_of::() - 4usize]; - ["Alignment of sched_param"][::std::mem::align_of::() - 4usize]; - ["Offset of field: sched_param::sched_priority"] - [::std::mem::offset_of!(sched_param, sched_priority) - 0usize]; -}; -extern "C" { - pub fn clone( - __fn: ::std::option::Option< - unsafe extern "C" fn(__arg: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, - >, - __child_stack: *mut ::std::os::raw::c_void, - __flags: ::std::os::raw::c_int, - __arg: *mut ::std::os::raw::c_void, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn unshare(__flags: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_getcpu() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getcpu( - arg1: *mut ::std::os::raw::c_uint, - arg2: *mut ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setns( - __fd: ::std::os::raw::c_int, - __nstype: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -pub type __cpu_mask = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct cpu_set_t { - pub __bits: [__cpu_mask; 16usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of cpu_set_t"][::std::mem::size_of::() - 128usize]; - ["Alignment of cpu_set_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: cpu_set_t::__bits"][::std::mem::offset_of!(cpu_set_t, __bits) - 0usize]; -}; -extern "C" { - pub fn __sched_cpucount(__setsize: usize, __setp: *const cpu_set_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __sched_cpualloc(__count: usize) -> *mut cpu_set_t; -} -extern "C" { - pub fn __sched_cpufree(__set: *mut cpu_set_t); -} -extern "C" { - pub fn sched_setparam(__pid: __pid_t, __param: *const sched_param) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_getparam(__pid: __pid_t, __param: *mut sched_param) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_setscheduler( - __pid: __pid_t, - __policy: ::std::os::raw::c_int, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_getscheduler(__pid: __pid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_yield() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_get_priority_max(__algorithm: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_get_priority_min(__algorithm: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_rr_get_interval(__pid: __pid_t, __t: *mut timespec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_setaffinity( - __pid: __pid_t, - __cpusetsize: usize, - __cpuset: *const cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_getaffinity( - __pid: __pid_t, - __cpusetsize: usize, - __cpuset: *mut cpu_set_t, - ) -> ::std::os::raw::c_int; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timeval { - pub tv_sec: __time_t, - pub tv_usec: __suseconds_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of timeval"][::std::mem::size_of::() - 16usize]; - ["Alignment of timeval"][::std::mem::align_of::() - 8usize]; - ["Offset of field: timeval::tv_sec"][::std::mem::offset_of!(timeval, tv_sec) - 0usize]; - ["Offset of field: timeval::tv_usec"][::std::mem::offset_of!(timeval, tv_usec) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timex { - pub modes: ::std::os::raw::c_uint, - pub offset: __syscall_slong_t, - pub freq: __syscall_slong_t, - pub maxerror: __syscall_slong_t, - pub esterror: __syscall_slong_t, - pub status: ::std::os::raw::c_int, - pub constant: __syscall_slong_t, - pub precision: __syscall_slong_t, - pub tolerance: __syscall_slong_t, - pub time: timeval, - pub tick: __syscall_slong_t, - pub ppsfreq: __syscall_slong_t, - pub jitter: __syscall_slong_t, - pub shift: ::std::os::raw::c_int, - pub stabil: __syscall_slong_t, - pub jitcnt: __syscall_slong_t, - pub calcnt: __syscall_slong_t, - pub errcnt: __syscall_slong_t, - pub stbcnt: __syscall_slong_t, - pub tai: ::std::os::raw::c_int, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 44usize]>, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of timex"][::std::mem::size_of::() - 208usize]; - ["Alignment of timex"][::std::mem::align_of::() - 8usize]; - ["Offset of field: timex::modes"][::std::mem::offset_of!(timex, modes) - 0usize]; - ["Offset of field: timex::offset"][::std::mem::offset_of!(timex, offset) - 8usize]; - ["Offset of field: timex::freq"][::std::mem::offset_of!(timex, freq) - 16usize]; - ["Offset of field: timex::maxerror"][::std::mem::offset_of!(timex, maxerror) - 24usize]; - ["Offset of field: timex::esterror"][::std::mem::offset_of!(timex, esterror) - 32usize]; - ["Offset of field: timex::status"][::std::mem::offset_of!(timex, status) - 40usize]; - ["Offset of field: timex::constant"][::std::mem::offset_of!(timex, constant) - 48usize]; - ["Offset of field: timex::precision"][::std::mem::offset_of!(timex, precision) - 56usize]; - ["Offset of field: timex::tolerance"][::std::mem::offset_of!(timex, tolerance) - 64usize]; - ["Offset of field: timex::time"][::std::mem::offset_of!(timex, time) - 72usize]; - ["Offset of field: timex::tick"][::std::mem::offset_of!(timex, tick) - 88usize]; - ["Offset of field: timex::ppsfreq"][::std::mem::offset_of!(timex, ppsfreq) - 96usize]; - ["Offset of field: timex::jitter"][::std::mem::offset_of!(timex, jitter) - 104usize]; - ["Offset of field: timex::shift"][::std::mem::offset_of!(timex, shift) - 112usize]; - ["Offset of field: timex::stabil"][::std::mem::offset_of!(timex, stabil) - 120usize]; - ["Offset of field: timex::jitcnt"][::std::mem::offset_of!(timex, jitcnt) - 128usize]; - ["Offset of field: timex::calcnt"][::std::mem::offset_of!(timex, calcnt) - 136usize]; - ["Offset of field: timex::errcnt"][::std::mem::offset_of!(timex, errcnt) - 144usize]; - ["Offset of field: timex::stbcnt"][::std::mem::offset_of!(timex, stbcnt) - 152usize]; - ["Offset of field: timex::tai"][::std::mem::offset_of!(timex, tai) - 160usize]; -}; -extern "C" { - pub fn clock_adjtime(__clock_id: __clockid_t, __utx: *mut timex) -> ::std::os::raw::c_int; -} -pub type clock_t = __clock_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct tm { - pub tm_sec: ::std::os::raw::c_int, - pub tm_min: ::std::os::raw::c_int, - pub tm_hour: ::std::os::raw::c_int, - pub tm_mday: ::std::os::raw::c_int, - pub tm_mon: ::std::os::raw::c_int, - pub tm_year: ::std::os::raw::c_int, - pub tm_wday: ::std::os::raw::c_int, - pub tm_yday: ::std::os::raw::c_int, - pub tm_isdst: ::std::os::raw::c_int, - pub tm_gmtoff: ::std::os::raw::c_long, - pub tm_zone: *const ::std::os::raw::c_char, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of tm"][::std::mem::size_of::() - 56usize]; - ["Alignment of tm"][::std::mem::align_of::() - 8usize]; - ["Offset of field: tm::tm_sec"][::std::mem::offset_of!(tm, tm_sec) - 0usize]; - ["Offset of field: tm::tm_min"][::std::mem::offset_of!(tm, tm_min) - 4usize]; - ["Offset of field: tm::tm_hour"][::std::mem::offset_of!(tm, tm_hour) - 8usize]; - ["Offset of field: tm::tm_mday"][::std::mem::offset_of!(tm, tm_mday) - 12usize]; - ["Offset of field: tm::tm_mon"][::std::mem::offset_of!(tm, tm_mon) - 16usize]; - ["Offset of field: tm::tm_year"][::std::mem::offset_of!(tm, tm_year) - 20usize]; - ["Offset of field: tm::tm_wday"][::std::mem::offset_of!(tm, tm_wday) - 24usize]; - ["Offset of field: tm::tm_yday"][::std::mem::offset_of!(tm, tm_yday) - 28usize]; - ["Offset of field: tm::tm_isdst"][::std::mem::offset_of!(tm, tm_isdst) - 32usize]; - ["Offset of field: tm::tm_gmtoff"][::std::mem::offset_of!(tm, tm_gmtoff) - 40usize]; - ["Offset of field: tm::tm_zone"][::std::mem::offset_of!(tm, tm_zone) - 48usize]; -}; -pub type clockid_t = __clockid_t; -pub type timer_t = __timer_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct itimerspec { - pub it_interval: timespec, - pub it_value: timespec, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of itimerspec"][::std::mem::size_of::() - 32usize]; - ["Alignment of itimerspec"][::std::mem::align_of::() - 8usize]; - ["Offset of field: itimerspec::it_interval"] - [::std::mem::offset_of!(itimerspec, it_interval) - 0usize]; - ["Offset of field: itimerspec::it_value"] - [::std::mem::offset_of!(itimerspec, it_value) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sigevent { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __locale_struct { - pub __locales: [*mut __locale_data; 13usize], - pub __ctype_b: *const ::std::os::raw::c_ushort, - pub __ctype_tolower: *const ::std::os::raw::c_int, - pub __ctype_toupper: *const ::std::os::raw::c_int, - pub __names: [*const ::std::os::raw::c_char; 13usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __locale_struct"][::std::mem::size_of::<__locale_struct>() - 232usize]; - ["Alignment of __locale_struct"][::std::mem::align_of::<__locale_struct>() - 8usize]; - ["Offset of field: __locale_struct::__locales"] - [::std::mem::offset_of!(__locale_struct, __locales) - 0usize]; - ["Offset of field: __locale_struct::__ctype_b"] - [::std::mem::offset_of!(__locale_struct, __ctype_b) - 104usize]; - ["Offset of field: __locale_struct::__ctype_tolower"] - [::std::mem::offset_of!(__locale_struct, __ctype_tolower) - 112usize]; - ["Offset of field: __locale_struct::__ctype_toupper"] - [::std::mem::offset_of!(__locale_struct, __ctype_toupper) - 120usize]; - ["Offset of field: __locale_struct::__names"] - [::std::mem::offset_of!(__locale_struct, __names) - 128usize]; -}; -pub type __locale_t = *mut __locale_struct; -pub type locale_t = __locale_t; -extern "C" { - pub fn clock() -> clock_t; -} -extern "C" { - pub fn time(__timer: *mut time_t) -> time_t; -} -extern "C" { - pub fn difftime(__time1: time_t, __time0: time_t) -> f64; -} -extern "C" { - pub fn mktime(__tp: *mut tm) -> time_t; -} -extern "C" { - pub fn strftime( - __s: *mut ::std::os::raw::c_char, - __maxsize: usize, - __format: *const ::std::os::raw::c_char, - __tp: *const tm, - ) -> usize; -} -extern "C" { - pub fn strptime( - __s: *const ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - __tp: *mut tm, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strftime_l( - __s: *mut ::std::os::raw::c_char, - __maxsize: usize, - __format: *const ::std::os::raw::c_char, - __tp: *const tm, - __loc: locale_t, - ) -> usize; -} -extern "C" { - pub fn strptime_l( - __s: *const ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - __tp: *mut tm, - __loc: locale_t, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn gmtime(__timer: *const time_t) -> *mut tm; -} -extern "C" { - pub fn localtime(__timer: *const time_t) -> *mut tm; -} -extern "C" { - pub fn gmtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm; -} -extern "C" { - pub fn localtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm; -} -extern "C" { - pub fn asctime(__tp: *const tm) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ctime(__timer: *const time_t) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn asctime_r( - __tp: *const tm, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ctime_r( - __timer: *const time_t, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub static mut __tzname: [*mut ::std::os::raw::c_char; 2usize]; -} -extern "C" { - pub static mut __daylight: ::std::os::raw::c_int; -} -extern "C" { - pub static mut __timezone: ::std::os::raw::c_long; -} -extern "C" { - pub static mut tzname: [*mut ::std::os::raw::c_char; 2usize]; -} -extern "C" { - pub fn tzset(); -} -extern "C" { - pub static mut daylight: ::std::os::raw::c_int; -} -extern "C" { - pub static mut timezone: ::std::os::raw::c_long; -} -extern "C" { - pub fn timegm(__tp: *mut tm) -> time_t; -} -extern "C" { - pub fn timelocal(__tp: *mut tm) -> time_t; -} -extern "C" { - pub fn dysize(__year: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nanosleep( - __requested_time: *const timespec, - __remaining: *mut timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_getres(__clock_id: clockid_t, __res: *mut timespec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut timespec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_settime(__clock_id: clockid_t, __tp: *const timespec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_nanosleep( - __clock_id: clockid_t, - __flags: ::std::os::raw::c_int, - __req: *const timespec, - __rem: *mut timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_getcpuclockid(__pid: pid_t, __clock_id: *mut clockid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_create( - __clock_id: clockid_t, - __evp: *mut sigevent, - __timerid: *mut timer_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_delete(__timerid: timer_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_settime( - __timerid: timer_t, - __flags: ::std::os::raw::c_int, - __value: *const itimerspec, - __ovalue: *mut itimerspec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_gettime(__timerid: timer_t, __value: *mut itimerspec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_getoverrun(__timerid: timer_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timespec_get( - __ts: *mut timespec, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timespec_getres( - __ts: *mut timespec, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub static mut getdate_err: ::std::os::raw::c_int; -} -extern "C" { - pub fn getdate(__string: *const ::std::os::raw::c_char) -> *mut tm; -} -extern "C" { - pub fn getdate_r( - __string: *const ::std::os::raw::c_char, - __resbufp: *mut tm, - ) -> ::std::os::raw::c_int; -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __atomic_wide_counter { - pub __value64: ::std::os::raw::c_ulonglong, - pub __value32: __atomic_wide_counter__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __atomic_wide_counter__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __atomic_wide_counter__bindgen_ty_1"] - [::std::mem::size_of::<__atomic_wide_counter__bindgen_ty_1>() - 8usize]; - ["Alignment of __atomic_wide_counter__bindgen_ty_1"] - [::std::mem::align_of::<__atomic_wide_counter__bindgen_ty_1>() - 4usize]; - ["Offset of field: __atomic_wide_counter__bindgen_ty_1::__low"] - [::std::mem::offset_of!(__atomic_wide_counter__bindgen_ty_1, __low) - 0usize]; - ["Offset of field: __atomic_wide_counter__bindgen_ty_1::__high"] - [::std::mem::offset_of!(__atomic_wide_counter__bindgen_ty_1, __high) - 4usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __atomic_wide_counter"][::std::mem::size_of::<__atomic_wide_counter>() - 8usize]; - ["Alignment of __atomic_wide_counter"] - [::std::mem::align_of::<__atomic_wide_counter>() - 8usize]; - ["Offset of field: __atomic_wide_counter::__value64"] - [::std::mem::offset_of!(__atomic_wide_counter, __value64) - 0usize]; - ["Offset of field: __atomic_wide_counter::__value32"] - [::std::mem::offset_of!(__atomic_wide_counter, __value32) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_list { - pub __prev: *mut __pthread_internal_list, - pub __next: *mut __pthread_internal_list, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_internal_list"][::std::mem::size_of::<__pthread_internal_list>() - 16usize]; - ["Alignment of __pthread_internal_list"] - [::std::mem::align_of::<__pthread_internal_list>() - 8usize]; - ["Offset of field: __pthread_internal_list::__prev"] - [::std::mem::offset_of!(__pthread_internal_list, __prev) - 0usize]; - ["Offset of field: __pthread_internal_list::__next"] - [::std::mem::offset_of!(__pthread_internal_list, __next) - 8usize]; -}; -pub type __pthread_list_t = __pthread_internal_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_slist { - pub __next: *mut __pthread_internal_slist, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_internal_slist"] - [::std::mem::size_of::<__pthread_internal_slist>() - 8usize]; - ["Alignment of __pthread_internal_slist"] - [::std::mem::align_of::<__pthread_internal_slist>() - 8usize]; - ["Offset of field: __pthread_internal_slist::__next"] - [::std::mem::offset_of!(__pthread_internal_slist, __next) - 0usize]; -}; -pub type __pthread_slist_t = __pthread_internal_slist; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_mutex_s { - pub __lock: ::std::os::raw::c_int, - pub __count: ::std::os::raw::c_uint, - pub __owner: ::std::os::raw::c_int, - pub __nusers: ::std::os::raw::c_uint, - pub __kind: ::std::os::raw::c_int, - pub __spins: ::std::os::raw::c_short, - pub __elision: ::std::os::raw::c_short, - pub __list: __pthread_list_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_mutex_s"][::std::mem::size_of::<__pthread_mutex_s>() - 40usize]; - ["Alignment of __pthread_mutex_s"][::std::mem::align_of::<__pthread_mutex_s>() - 8usize]; - ["Offset of field: __pthread_mutex_s::__lock"] - [::std::mem::offset_of!(__pthread_mutex_s, __lock) - 0usize]; - ["Offset of field: __pthread_mutex_s::__count"] - [::std::mem::offset_of!(__pthread_mutex_s, __count) - 4usize]; - ["Offset of field: __pthread_mutex_s::__owner"] - [::std::mem::offset_of!(__pthread_mutex_s, __owner) - 8usize]; - ["Offset of field: __pthread_mutex_s::__nusers"] - [::std::mem::offset_of!(__pthread_mutex_s, __nusers) - 12usize]; - ["Offset of field: __pthread_mutex_s::__kind"] - [::std::mem::offset_of!(__pthread_mutex_s, __kind) - 16usize]; - ["Offset of field: __pthread_mutex_s::__spins"] - [::std::mem::offset_of!(__pthread_mutex_s, __spins) - 20usize]; - ["Offset of field: __pthread_mutex_s::__elision"] - [::std::mem::offset_of!(__pthread_mutex_s, __elision) - 22usize]; - ["Offset of field: __pthread_mutex_s::__list"] - [::std::mem::offset_of!(__pthread_mutex_s, __list) - 24usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_rwlock_arch_t { - pub __readers: ::std::os::raw::c_uint, - pub __writers: ::std::os::raw::c_uint, - pub __wrphase_futex: ::std::os::raw::c_uint, - pub __writers_futex: ::std::os::raw::c_uint, - pub __pad3: ::std::os::raw::c_uint, - pub __pad4: ::std::os::raw::c_uint, - pub __cur_writer: ::std::os::raw::c_int, - pub __shared: ::std::os::raw::c_int, - pub __rwelision: ::std::os::raw::c_schar, - pub __pad1: [::std::os::raw::c_uchar; 7usize], - pub __pad2: ::std::os::raw::c_ulong, - pub __flags: ::std::os::raw::c_uint, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_rwlock_arch_t"][::std::mem::size_of::<__pthread_rwlock_arch_t>() - 56usize]; - ["Alignment of __pthread_rwlock_arch_t"] - [::std::mem::align_of::<__pthread_rwlock_arch_t>() - 8usize]; - ["Offset of field: __pthread_rwlock_arch_t::__readers"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __readers) - 0usize]; - ["Offset of field: __pthread_rwlock_arch_t::__writers"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __writers) - 4usize]; - ["Offset of field: __pthread_rwlock_arch_t::__wrphase_futex"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __wrphase_futex) - 8usize]; - ["Offset of field: __pthread_rwlock_arch_t::__writers_futex"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __writers_futex) - 12usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad3"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad3) - 16usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad4"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad4) - 20usize]; - ["Offset of field: __pthread_rwlock_arch_t::__cur_writer"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __cur_writer) - 24usize]; - ["Offset of field: __pthread_rwlock_arch_t::__shared"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __shared) - 28usize]; - ["Offset of field: __pthread_rwlock_arch_t::__rwelision"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __rwelision) - 32usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad1"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad1) - 33usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad2"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad2) - 40usize]; - ["Offset of field: __pthread_rwlock_arch_t::__flags"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __flags) - 48usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __pthread_cond_s { - pub __wseq: __atomic_wide_counter, - pub __g1_start: __atomic_wide_counter, - pub __g_refs: [::std::os::raw::c_uint; 2usize], - pub __g_size: [::std::os::raw::c_uint; 2usize], - pub __g1_orig_size: ::std::os::raw::c_uint, - pub __wrefs: ::std::os::raw::c_uint, - pub __g_signals: [::std::os::raw::c_uint; 2usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_cond_s"][::std::mem::size_of::<__pthread_cond_s>() - 48usize]; - ["Alignment of __pthread_cond_s"][::std::mem::align_of::<__pthread_cond_s>() - 8usize]; - ["Offset of field: __pthread_cond_s::__wseq"] - [::std::mem::offset_of!(__pthread_cond_s, __wseq) - 0usize]; - ["Offset of field: __pthread_cond_s::__g1_start"] - [::std::mem::offset_of!(__pthread_cond_s, __g1_start) - 8usize]; - ["Offset of field: __pthread_cond_s::__g_refs"] - [::std::mem::offset_of!(__pthread_cond_s, __g_refs) - 16usize]; - ["Offset of field: __pthread_cond_s::__g_size"] - [::std::mem::offset_of!(__pthread_cond_s, __g_size) - 24usize]; - ["Offset of field: __pthread_cond_s::__g1_orig_size"] - [::std::mem::offset_of!(__pthread_cond_s, __g1_orig_size) - 32usize]; - ["Offset of field: __pthread_cond_s::__wrefs"] - [::std::mem::offset_of!(__pthread_cond_s, __wrefs) - 36usize]; - ["Offset of field: __pthread_cond_s::__g_signals"] - [::std::mem::offset_of!(__pthread_cond_s, __g_signals) - 40usize]; -}; -pub type __tss_t = ::std::os::raw::c_uint; -pub type __thrd_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __once_flag { - pub __data: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __once_flag"][::std::mem::size_of::<__once_flag>() - 4usize]; - ["Alignment of __once_flag"][::std::mem::align_of::<__once_flag>() - 4usize]; - ["Offset of field: __once_flag::__data"][::std::mem::offset_of!(__once_flag, __data) - 0usize]; -}; -pub type pthread_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutexattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_mutexattr_t"][::std::mem::size_of::() - 4usize]; - ["Alignment of pthread_mutexattr_t"][::std::mem::align_of::() - 4usize]; - ["Offset of field: pthread_mutexattr_t::__size"] - [::std::mem::offset_of!(pthread_mutexattr_t, __size) - 0usize]; - ["Offset of field: pthread_mutexattr_t::__align"] - [::std::mem::offset_of!(pthread_mutexattr_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_condattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_condattr_t"][::std::mem::size_of::() - 4usize]; - ["Alignment of pthread_condattr_t"][::std::mem::align_of::() - 4usize]; - ["Offset of field: pthread_condattr_t::__size"] - [::std::mem::offset_of!(pthread_condattr_t, __size) - 0usize]; - ["Offset of field: pthread_condattr_t::__align"] - [::std::mem::offset_of!(pthread_condattr_t, __align) - 0usize]; -}; -pub type pthread_key_t = ::std::os::raw::c_uint; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_attr_t { - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_attr_t"][::std::mem::size_of::() - 56usize]; - ["Alignment of pthread_attr_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_attr_t::__size"] - [::std::mem::offset_of!(pthread_attr_t, __size) - 0usize]; - ["Offset of field: pthread_attr_t::__align"] - [::std::mem::offset_of!(pthread_attr_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutex_t { - pub __data: __pthread_mutex_s, - pub __size: [::std::os::raw::c_char; 40usize], - pub __align: ::std::os::raw::c_long, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_mutex_t"][::std::mem::size_of::() - 40usize]; - ["Alignment of pthread_mutex_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_mutex_t::__data"] - [::std::mem::offset_of!(pthread_mutex_t, __data) - 0usize]; - ["Offset of field: pthread_mutex_t::__size"] - [::std::mem::offset_of!(pthread_mutex_t, __size) - 0usize]; - ["Offset of field: pthread_mutex_t::__align"] - [::std::mem::offset_of!(pthread_mutex_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_cond_t { - pub __data: __pthread_cond_s, - pub __size: [::std::os::raw::c_char; 48usize], - pub __align: ::std::os::raw::c_longlong, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_cond_t"][::std::mem::size_of::() - 48usize]; - ["Alignment of pthread_cond_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_cond_t::__data"] - [::std::mem::offset_of!(pthread_cond_t, __data) - 0usize]; - ["Offset of field: pthread_cond_t::__size"] - [::std::mem::offset_of!(pthread_cond_t, __size) - 0usize]; - ["Offset of field: pthread_cond_t::__align"] - [::std::mem::offset_of!(pthread_cond_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlock_t { - pub __data: __pthread_rwlock_arch_t, - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_rwlock_t"][::std::mem::size_of::() - 56usize]; - ["Alignment of pthread_rwlock_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_rwlock_t::__data"] - [::std::mem::offset_of!(pthread_rwlock_t, __data) - 0usize]; - ["Offset of field: pthread_rwlock_t::__size"] - [::std::mem::offset_of!(pthread_rwlock_t, __size) - 0usize]; - ["Offset of field: pthread_rwlock_t::__align"] - [::std::mem::offset_of!(pthread_rwlock_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlockattr_t { - pub __size: [::std::os::raw::c_char; 8usize], - pub __align: ::std::os::raw::c_long, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_rwlockattr_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of pthread_rwlockattr_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_rwlockattr_t::__size"] - [::std::mem::offset_of!(pthread_rwlockattr_t, __size) - 0usize]; - ["Offset of field: pthread_rwlockattr_t::__align"] - [::std::mem::offset_of!(pthread_rwlockattr_t, __align) - 0usize]; -}; -pub type pthread_spinlock_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrier_t { - pub __size: [::std::os::raw::c_char; 32usize], - pub __align: ::std::os::raw::c_long, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_barrier_t"][::std::mem::size_of::() - 32usize]; - ["Alignment of pthread_barrier_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_barrier_t::__size"] - [::std::mem::offset_of!(pthread_barrier_t, __size) - 0usize]; - ["Offset of field: pthread_barrier_t::__align"] - [::std::mem::offset_of!(pthread_barrier_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrierattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_barrierattr_t"][::std::mem::size_of::() - 4usize]; - ["Alignment of pthread_barrierattr_t"] - [::std::mem::align_of::() - 4usize]; - ["Offset of field: pthread_barrierattr_t::__size"] - [::std::mem::offset_of!(pthread_barrierattr_t, __size) - 0usize]; - ["Offset of field: pthread_barrierattr_t::__align"] - [::std::mem::offset_of!(pthread_barrierattr_t, __align) - 0usize]; -}; -extern "C" { - pub fn __sysconf(__name: ::std::os::raw::c_int) -> ::std::os::raw::c_long; -} -pub const PTHREAD_CREATE_JOINABLE: _bindgen_ty_1 = 0; -pub const PTHREAD_CREATE_DETACHED: _bindgen_ty_1 = 1; -pub type _bindgen_ty_1 = ::std::os::raw::c_uint; -pub const PTHREAD_MUTEX_TIMED_NP: _bindgen_ty_2 = 0; -pub const PTHREAD_MUTEX_RECURSIVE_NP: _bindgen_ty_2 = 1; -pub const PTHREAD_MUTEX_ERRORCHECK_NP: _bindgen_ty_2 = 2; -pub const PTHREAD_MUTEX_ADAPTIVE_NP: _bindgen_ty_2 = 3; -pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_2 = 0; -pub const PTHREAD_MUTEX_RECURSIVE: _bindgen_ty_2 = 1; -pub const PTHREAD_MUTEX_ERRORCHECK: _bindgen_ty_2 = 2; -pub const PTHREAD_MUTEX_DEFAULT: _bindgen_ty_2 = 0; -pub const PTHREAD_MUTEX_FAST_NP: _bindgen_ty_2 = 0; -pub type _bindgen_ty_2 = ::std::os::raw::c_uint; -pub const PTHREAD_MUTEX_STALLED: _bindgen_ty_3 = 0; -pub const PTHREAD_MUTEX_STALLED_NP: _bindgen_ty_3 = 0; -pub const PTHREAD_MUTEX_ROBUST: _bindgen_ty_3 = 1; -pub const PTHREAD_MUTEX_ROBUST_NP: _bindgen_ty_3 = 1; -pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -pub const PTHREAD_PRIO_NONE: _bindgen_ty_4 = 0; -pub const PTHREAD_PRIO_INHERIT: _bindgen_ty_4 = 1; -pub const PTHREAD_PRIO_PROTECT: _bindgen_ty_4 = 2; -pub type _bindgen_ty_4 = ::std::os::raw::c_uint; -pub const PTHREAD_RWLOCK_PREFER_READER_NP: _bindgen_ty_5 = 0; -pub const PTHREAD_RWLOCK_PREFER_WRITER_NP: _bindgen_ty_5 = 1; -pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: _bindgen_ty_5 = 2; -pub const PTHREAD_RWLOCK_DEFAULT_NP: _bindgen_ty_5 = 0; -pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -pub const PTHREAD_INHERIT_SCHED: _bindgen_ty_6 = 0; -pub const PTHREAD_EXPLICIT_SCHED: _bindgen_ty_6 = 1; -pub type _bindgen_ty_6 = ::std::os::raw::c_uint; -pub const PTHREAD_SCOPE_SYSTEM: _bindgen_ty_7 = 0; -pub const PTHREAD_SCOPE_PROCESS: _bindgen_ty_7 = 1; -pub type _bindgen_ty_7 = ::std::os::raw::c_uint; -pub const PTHREAD_PROCESS_PRIVATE: _bindgen_ty_8 = 0; -pub const PTHREAD_PROCESS_SHARED: _bindgen_ty_8 = 1; -pub type _bindgen_ty_8 = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _pthread_cleanup_buffer { - pub __routine: ::std::option::Option, - pub __arg: *mut ::std::os::raw::c_void, - pub __canceltype: ::std::os::raw::c_int, - pub __prev: *mut _pthread_cleanup_buffer, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _pthread_cleanup_buffer"][::std::mem::size_of::<_pthread_cleanup_buffer>() - 32usize]; - ["Alignment of _pthread_cleanup_buffer"] - [::std::mem::align_of::<_pthread_cleanup_buffer>() - 8usize]; - ["Offset of field: _pthread_cleanup_buffer::__routine"] - [::std::mem::offset_of!(_pthread_cleanup_buffer, __routine) - 0usize]; - ["Offset of field: _pthread_cleanup_buffer::__arg"] - [::std::mem::offset_of!(_pthread_cleanup_buffer, __arg) - 8usize]; - ["Offset of field: _pthread_cleanup_buffer::__canceltype"] - [::std::mem::offset_of!(_pthread_cleanup_buffer, __canceltype) - 16usize]; - ["Offset of field: _pthread_cleanup_buffer::__prev"] - [::std::mem::offset_of!(_pthread_cleanup_buffer, __prev) - 24usize]; -}; -pub const PTHREAD_CANCEL_ENABLE: _bindgen_ty_9 = 0; -pub const PTHREAD_CANCEL_DISABLE: _bindgen_ty_9 = 1; -pub type _bindgen_ty_9 = ::std::os::raw::c_uint; -pub const PTHREAD_CANCEL_DEFERRED: _bindgen_ty_10 = 0; -pub const PTHREAD_CANCEL_ASYNCHRONOUS: _bindgen_ty_10 = 1; -pub type _bindgen_ty_10 = ::std::os::raw::c_uint; -extern "C" { - pub fn pthread_create( - __newthread: *mut pthread_t, - __attr: *const pthread_attr_t, - __start_routine: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void, - >, - __arg: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_exit(__retval: *mut ::std::os::raw::c_void) -> !; -} -extern "C" { - pub fn pthread_join( - __th: pthread_t, - __thread_return: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_tryjoin_np( - __th: pthread_t, - __thread_return: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_timedjoin_np( - __th: pthread_t, - __thread_return: *mut *mut ::std::os::raw::c_void, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_clockjoin_np( - __th: pthread_t, - __thread_return: *mut *mut ::std::os::raw::c_void, - __clockid: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_detach(__th: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_self() -> pthread_t; -} -extern "C" { - pub fn pthread_equal(__thread1: pthread_t, __thread2: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_init(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_destroy(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getdetachstate( - __attr: *const pthread_attr_t, - __detachstate: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setdetachstate( - __attr: *mut pthread_attr_t, - __detachstate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getguardsize( - __attr: *const pthread_attr_t, - __guardsize: *mut usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setguardsize( - __attr: *mut pthread_attr_t, - __guardsize: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedparam( - __attr: *const pthread_attr_t, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedparam( - __attr: *mut pthread_attr_t, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedpolicy( - __attr: *const pthread_attr_t, - __policy: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedpolicy( - __attr: *mut pthread_attr_t, - __policy: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getinheritsched( - __attr: *const pthread_attr_t, - __inherit: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setinheritsched( - __attr: *mut pthread_attr_t, - __inherit: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getscope( - __attr: *const pthread_attr_t, - __scope: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setscope( - __attr: *mut pthread_attr_t, - __scope: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstackaddr( - __attr: *const pthread_attr_t, - __stackaddr: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstackaddr( - __attr: *mut pthread_attr_t, - __stackaddr: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstacksize( - __attr: *const pthread_attr_t, - __stacksize: *mut usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstacksize( - __attr: *mut pthread_attr_t, - __stacksize: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstack( - __attr: *const pthread_attr_t, - __stackaddr: *mut *mut ::std::os::raw::c_void, - __stacksize: *mut usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstack( - __attr: *mut pthread_attr_t, - __stackaddr: *mut ::std::os::raw::c_void, - __stacksize: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setaffinity_np( - __attr: *mut pthread_attr_t, - __cpusetsize: usize, - __cpuset: *const cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getaffinity_np( - __attr: *const pthread_attr_t, - __cpusetsize: usize, - __cpuset: *mut cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getattr_default_np(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setsigmask_np( - __attr: *mut pthread_attr_t, - sigmask: *const __sigset_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getsigmask_np( - __attr: *const pthread_attr_t, - sigmask: *mut __sigset_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setattr_default_np(__attr: *const pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getattr_np( - __th: pthread_t, - __attr: *mut pthread_attr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedparam( - __target_thread: pthread_t, - __policy: ::std::os::raw::c_int, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getschedparam( - __target_thread: pthread_t, - __policy: *mut ::std::os::raw::c_int, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedprio( - __target_thread: pthread_t, - __prio: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getname_np( - __target_thread: pthread_t, - __buf: *mut ::std::os::raw::c_char, - __buflen: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setname_np( - __target_thread: pthread_t, - __name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getconcurrency() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setconcurrency(__level: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_yield() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setaffinity_np( - __th: pthread_t, - __cpusetsize: usize, - __cpuset: *const cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getaffinity_np( - __th: pthread_t, - __cpusetsize: usize, - __cpuset: *mut cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_once( - __once_control: *mut pthread_once_t, - __init_routine: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setcancelstate( - __state: ::std::os::raw::c_int, - __oldstate: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setcanceltype( - __type: ::std::os::raw::c_int, - __oldtype: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cancel(__th: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_testcancel(); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __cancel_jmp_buf_tag { - pub __cancel_jmp_buf: __jmp_buf, - pub __mask_was_saved: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __cancel_jmp_buf_tag"][::std::mem::size_of::<__cancel_jmp_buf_tag>() - 72usize]; - ["Alignment of __cancel_jmp_buf_tag"][::std::mem::align_of::<__cancel_jmp_buf_tag>() - 8usize]; - ["Offset of field: __cancel_jmp_buf_tag::__cancel_jmp_buf"] - [::std::mem::offset_of!(__cancel_jmp_buf_tag, __cancel_jmp_buf) - 0usize]; - ["Offset of field: __cancel_jmp_buf_tag::__mask_was_saved"] - [::std::mem::offset_of!(__cancel_jmp_buf_tag, __mask_was_saved) - 64usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_unwind_buf_t { - pub __cancel_jmp_buf: [__cancel_jmp_buf_tag; 1usize], - pub __pad: [*mut ::std::os::raw::c_void; 4usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_unwind_buf_t"][::std::mem::size_of::<__pthread_unwind_buf_t>() - 104usize]; - ["Alignment of __pthread_unwind_buf_t"] - [::std::mem::align_of::<__pthread_unwind_buf_t>() - 8usize]; - ["Offset of field: __pthread_unwind_buf_t::__cancel_jmp_buf"] - [::std::mem::offset_of!(__pthread_unwind_buf_t, __cancel_jmp_buf) - 0usize]; - ["Offset of field: __pthread_unwind_buf_t::__pad"] - [::std::mem::offset_of!(__pthread_unwind_buf_t, __pad) - 72usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_cleanup_frame { - pub __cancel_routine: - ::std::option::Option, - pub __cancel_arg: *mut ::std::os::raw::c_void, - pub __do_it: ::std::os::raw::c_int, - pub __cancel_type: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_cleanup_frame"][::std::mem::size_of::<__pthread_cleanup_frame>() - 24usize]; - ["Alignment of __pthread_cleanup_frame"] - [::std::mem::align_of::<__pthread_cleanup_frame>() - 8usize]; - ["Offset of field: __pthread_cleanup_frame::__cancel_routine"] - [::std::mem::offset_of!(__pthread_cleanup_frame, __cancel_routine) - 0usize]; - ["Offset of field: __pthread_cleanup_frame::__cancel_arg"] - [::std::mem::offset_of!(__pthread_cleanup_frame, __cancel_arg) - 8usize]; - ["Offset of field: __pthread_cleanup_frame::__do_it"] - [::std::mem::offset_of!(__pthread_cleanup_frame, __do_it) - 16usize]; - ["Offset of field: __pthread_cleanup_frame::__cancel_type"] - [::std::mem::offset_of!(__pthread_cleanup_frame, __cancel_type) - 20usize]; -}; -#[repr(C)] -#[derive(Debug)] -pub struct __pthread_cleanup_class { - pub __cancel_routine: - ::std::option::Option, - pub __cancel_arg: *mut ::std::os::raw::c_void, - pub __do_it: ::std::os::raw::c_int, - pub __cancel_type: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_cleanup_class"][::std::mem::size_of::<__pthread_cleanup_class>() - 24usize]; - ["Alignment of __pthread_cleanup_class"] - [::std::mem::align_of::<__pthread_cleanup_class>() - 8usize]; - ["Offset of field: __pthread_cleanup_class::__cancel_routine"] - [::std::mem::offset_of!(__pthread_cleanup_class, __cancel_routine) - 0usize]; - ["Offset of field: __pthread_cleanup_class::__cancel_arg"] - [::std::mem::offset_of!(__pthread_cleanup_class, __cancel_arg) - 8usize]; - ["Offset of field: __pthread_cleanup_class::__do_it"] - [::std::mem::offset_of!(__pthread_cleanup_class, __do_it) - 16usize]; - ["Offset of field: __pthread_cleanup_class::__cancel_type"] - [::std::mem::offset_of!(__pthread_cleanup_class, __cancel_type) - 20usize]; -}; -extern "C" { - pub fn pthread_mutex_init( - __mutex: *mut pthread_mutex_t, - __mutexattr: *const pthread_mutexattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_destroy(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_trylock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_lock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock( - __mutex: *mut pthread_mutex_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_clocklock( - __mutex: *mut pthread_mutex_t, - __clockid: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_unlock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_getprioceiling( - __mutex: *const pthread_mutex_t, - __prioceiling: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_setprioceiling( - __mutex: *mut pthread_mutex_t, - __prioceiling: ::std::os::raw::c_int, - __old_ceiling: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_consistent(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_init(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_destroy(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getpshared( - __attr: *const pthread_mutexattr_t, - __pshared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setpshared( - __attr: *mut pthread_mutexattr_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_gettype( - __attr: *const pthread_mutexattr_t, - __kind: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_settype( - __attr: *mut pthread_mutexattr_t, - __kind: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getprotocol( - __attr: *const pthread_mutexattr_t, - __protocol: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setprotocol( - __attr: *mut pthread_mutexattr_t, - __protocol: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getprioceiling( - __attr: *const pthread_mutexattr_t, - __prioceiling: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setprioceiling( - __attr: *mut pthread_mutexattr_t, - __prioceiling: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getrobust( - __attr: *const pthread_mutexattr_t, - __robustness: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setrobust( - __attr: *mut pthread_mutexattr_t, - __robustness: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_init( - __rwlock: *mut pthread_rwlock_t, - __attr: *const pthread_rwlockattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_destroy(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_rdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_tryrdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock( - __rwlock: *mut pthread_rwlock_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockrdlock( - __rwlock: *mut pthread_rwlock_t, - __clockid: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_wrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_trywrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock( - __rwlock: *mut pthread_rwlock_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockwrlock( - __rwlock: *mut pthread_rwlock_t, - __clockid: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_unlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_init(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_destroy(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getpshared( - __attr: *const pthread_rwlockattr_t, - __pshared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setpshared( - __attr: *mut pthread_rwlockattr_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getkind_np( - __attr: *const pthread_rwlockattr_t, - __pref: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setkind_np( - __attr: *mut pthread_rwlockattr_t, - __pref: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_init( - __cond: *mut pthread_cond_t, - __cond_attr: *const pthread_condattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_destroy(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_signal(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_broadcast(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_wait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_clockwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __clock_id: __clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_init(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_destroy(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getpshared( - __attr: *const pthread_condattr_t, - __pshared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setpshared( - __attr: *mut pthread_condattr_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getclock( - __attr: *const pthread_condattr_t, - __clock_id: *mut __clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setclock( - __attr: *mut pthread_condattr_t, - __clock_id: __clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_init( - __lock: *mut pthread_spinlock_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_destroy(__lock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_lock(__lock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_trylock(__lock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_unlock(__lock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_init( - __barrier: *mut pthread_barrier_t, - __attr: *const pthread_barrierattr_t, - __count: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_destroy(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_wait(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_init(__attr: *mut pthread_barrierattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_destroy(__attr: *mut pthread_barrierattr_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_getpshared( - __attr: *const pthread_barrierattr_t, - __pshared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_setpshared( - __attr: *mut pthread_barrierattr_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_create( - __key: *mut pthread_key_t, - __destr_function: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void), - >, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_delete(__key: pthread_key_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getspecific(__key: pthread_key_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn pthread_setspecific( - __key: pthread_key_t, - __pointer: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getcpuclockid( - __thread_id: pthread_t, - __clock_id: *mut __clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_atfork( - __prepare: ::std::option::Option, - __parent: ::std::option::Option, - __child: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -pub const Allocator_AllocatorDefault: Allocator = 0; -pub const Allocator_AllocatorImmortal: Allocator = 1; -pub const Allocator_AllocatorLos: Allocator = 2; -pub const Allocator_AllocatorCode: Allocator = 3; -pub const Allocator_AllocatorReadOnly: Allocator = 4; -pub type Allocator = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RustDynPtr { - pub data: *mut ::std::os::raw::c_void, - pub vtable: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of RustDynPtr"][::std::mem::size_of::() - 16usize]; - ["Alignment of RustDynPtr"][::std::mem::align_of::() - 8usize]; - ["Offset of field: RustDynPtr::data"][::std::mem::offset_of!(RustDynPtr, data) - 0usize]; - ["Offset of field: RustDynPtr::vtable"][::std::mem::offset_of!(RustDynPtr, vtable) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BumpAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub cursor: *mut ::std::os::raw::c_void, - pub limit: *mut ::std::os::raw::c_void, - pub space: RustDynPtr, - pub context: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of BumpAllocator"][::std::mem::size_of::() - 48usize]; - ["Alignment of BumpAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: BumpAllocator::tls"][::std::mem::offset_of!(BumpAllocator, tls) - 0usize]; - ["Offset of field: BumpAllocator::cursor"] - [::std::mem::offset_of!(BumpAllocator, cursor) - 8usize]; - ["Offset of field: BumpAllocator::limit"] - [::std::mem::offset_of!(BumpAllocator, limit) - 16usize]; - ["Offset of field: BumpAllocator::space"] - [::std::mem::offset_of!(BumpAllocator, space) - 24usize]; - ["Offset of field: BumpAllocator::context"] - [::std::mem::offset_of!(BumpAllocator, context) - 40usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct LargeObjectAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub space: *mut ::std::os::raw::c_void, - pub context: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of LargeObjectAllocator"][::std::mem::size_of::() - 24usize]; - ["Alignment of LargeObjectAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: LargeObjectAllocator::tls"] - [::std::mem::offset_of!(LargeObjectAllocator, tls) - 0usize]; - ["Offset of field: LargeObjectAllocator::space"] - [::std::mem::offset_of!(LargeObjectAllocator, space) - 8usize]; - ["Offset of field: LargeObjectAllocator::context"] - [::std::mem::offset_of!(LargeObjectAllocator, context) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ImmixAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub cursor: *mut ::std::os::raw::c_void, - pub limit: *mut ::std::os::raw::c_void, - pub immix_space: *mut ::std::os::raw::c_void, - pub context: *mut ::std::os::raw::c_void, - pub hot: u8, - pub copy: u8, - pub large_cursor: *mut ::std::os::raw::c_void, - pub large_limit: *mut ::std::os::raw::c_void, - pub request_for_large: u8, - pub _align: [u8; 7usize], - pub line_opt_tag: u8, - pub line_opt: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of ImmixAllocator"][::std::mem::size_of::() - 88usize]; - ["Alignment of ImmixAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: ImmixAllocator::tls"][::std::mem::offset_of!(ImmixAllocator, tls) - 0usize]; - ["Offset of field: ImmixAllocator::cursor"] - [::std::mem::offset_of!(ImmixAllocator, cursor) - 8usize]; - ["Offset of field: ImmixAllocator::limit"] - [::std::mem::offset_of!(ImmixAllocator, limit) - 16usize]; - ["Offset of field: ImmixAllocator::immix_space"] - [::std::mem::offset_of!(ImmixAllocator, immix_space) - 24usize]; - ["Offset of field: ImmixAllocator::context"] - [::std::mem::offset_of!(ImmixAllocator, context) - 32usize]; - ["Offset of field: ImmixAllocator::hot"][::std::mem::offset_of!(ImmixAllocator, hot) - 40usize]; - ["Offset of field: ImmixAllocator::copy"] - [::std::mem::offset_of!(ImmixAllocator, copy) - 41usize]; - ["Offset of field: ImmixAllocator::large_cursor"] - [::std::mem::offset_of!(ImmixAllocator, large_cursor) - 48usize]; - ["Offset of field: ImmixAllocator::large_limit"] - [::std::mem::offset_of!(ImmixAllocator, large_limit) - 56usize]; - ["Offset of field: ImmixAllocator::request_for_large"] - [::std::mem::offset_of!(ImmixAllocator, request_for_large) - 64usize]; - ["Offset of field: ImmixAllocator::_align"] - [::std::mem::offset_of!(ImmixAllocator, _align) - 65usize]; - ["Offset of field: ImmixAllocator::line_opt_tag"] - [::std::mem::offset_of!(ImmixAllocator, line_opt_tag) - 72usize]; - ["Offset of field: ImmixAllocator::line_opt"] - [::std::mem::offset_of!(ImmixAllocator, line_opt) - 80usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FLBlock { - pub Address: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of FLBlock"][::std::mem::size_of::() - 8usize]; - ["Alignment of FLBlock"][::std::mem::align_of::() - 8usize]; - ["Offset of field: FLBlock::Address"][::std::mem::offset_of!(FLBlock, Address) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FLBlockList { - pub first: FLBlock, - pub last: FLBlock, - pub size: usize, - pub lock: ::std::os::raw::c_char, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of FLBlockList"][::std::mem::size_of::() - 32usize]; - ["Alignment of FLBlockList"][::std::mem::align_of::() - 8usize]; - ["Offset of field: FLBlockList::first"][::std::mem::offset_of!(FLBlockList, first) - 0usize]; - ["Offset of field: FLBlockList::last"][::std::mem::offset_of!(FLBlockList, last) - 8usize]; - ["Offset of field: FLBlockList::size"][::std::mem::offset_of!(FLBlockList, size) - 16usize]; - ["Offset of field: FLBlockList::lock"][::std::mem::offset_of!(FLBlockList, lock) - 24usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FreeListAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub space: *mut ::std::os::raw::c_void, - pub context: *mut ::std::os::raw::c_void, - pub available_blocks: *mut FLBlockList, - pub available_blocks_stress: *mut FLBlockList, - pub unswept_blocks: *mut FLBlockList, - pub consumed_blocks: *mut FLBlockList, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of FreeListAllocator"][::std::mem::size_of::() - 56usize]; - ["Alignment of FreeListAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: FreeListAllocator::tls"] - [::std::mem::offset_of!(FreeListAllocator, tls) - 0usize]; - ["Offset of field: FreeListAllocator::space"] - [::std::mem::offset_of!(FreeListAllocator, space) - 8usize]; - ["Offset of field: FreeListAllocator::context"] - [::std::mem::offset_of!(FreeListAllocator, context) - 16usize]; - ["Offset of field: FreeListAllocator::available_blocks"] - [::std::mem::offset_of!(FreeListAllocator, available_blocks) - 24usize]; - ["Offset of field: FreeListAllocator::available_blocks_stress"] - [::std::mem::offset_of!(FreeListAllocator, available_blocks_stress) - 32usize]; - ["Offset of field: FreeListAllocator::unswept_blocks"] - [::std::mem::offset_of!(FreeListAllocator, unswept_blocks) - 40usize]; - ["Offset of field: FreeListAllocator::consumed_blocks"] - [::std::mem::offset_of!(FreeListAllocator, consumed_blocks) - 48usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MMTkMallocAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub space: *mut ::std::os::raw::c_void, - pub context: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of MMTkMallocAllocator"][::std::mem::size_of::() - 24usize]; - ["Alignment of MMTkMallocAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: MMTkMallocAllocator::tls"] - [::std::mem::offset_of!(MMTkMallocAllocator, tls) - 0usize]; - ["Offset of field: MMTkMallocAllocator::space"] - [::std::mem::offset_of!(MMTkMallocAllocator, space) - 8usize]; - ["Offset of field: MMTkMallocAllocator::context"] - [::std::mem::offset_of!(MMTkMallocAllocator, context) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MarkCompactAllocator { - pub bump_allocator: BumpAllocator, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of MarkCompactAllocator"][::std::mem::size_of::() - 48usize]; - ["Alignment of MarkCompactAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: MarkCompactAllocator::bump_allocator"] - [::std::mem::offset_of!(MarkCompactAllocator, bump_allocator) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Allocators { - pub bump_pointer: [BumpAllocator; 6usize], - pub large_object: [LargeObjectAllocator; 2usize], - pub malloc: [MMTkMallocAllocator; 1usize], - pub immix: [ImmixAllocator; 1usize], - pub free_list: [FreeListAllocator; 2usize], - pub markcompact: [MarkCompactAllocator; 1usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of Allocators"][::std::mem::size_of::() - 608usize]; - ["Alignment of Allocators"][::std::mem::align_of::() - 8usize]; - ["Offset of field: Allocators::bump_pointer"] - [::std::mem::offset_of!(Allocators, bump_pointer) - 0usize]; - ["Offset of field: Allocators::large_object"] - [::std::mem::offset_of!(Allocators, large_object) - 288usize]; - ["Offset of field: Allocators::malloc"][::std::mem::offset_of!(Allocators, malloc) - 336usize]; - ["Offset of field: Allocators::immix"][::std::mem::offset_of!(Allocators, immix) - 360usize]; - ["Offset of field: Allocators::free_list"] - [::std::mem::offset_of!(Allocators, free_list) - 448usize]; - ["Offset of field: Allocators::markcompact"] - [::std::mem::offset_of!(Allocators, markcompact) - 560usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MutatorConfig { - pub allocator_mapping: *mut ::std::os::raw::c_void, - pub space_mapping: *mut ::std::os::raw::c_void, - pub prepare_func: RustDynPtr, - pub release_func: RustDynPtr, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of MutatorConfig"][::std::mem::size_of::() - 48usize]; - ["Alignment of MutatorConfig"][::std::mem::align_of::() - 8usize]; - ["Offset of field: MutatorConfig::allocator_mapping"] - [::std::mem::offset_of!(MutatorConfig, allocator_mapping) - 0usize]; - ["Offset of field: MutatorConfig::space_mapping"] - [::std::mem::offset_of!(MutatorConfig, space_mapping) - 8usize]; - ["Offset of field: MutatorConfig::prepare_func"] - [::std::mem::offset_of!(MutatorConfig, prepare_func) - 16usize]; - ["Offset of field: MutatorConfig::release_func"] - [::std::mem::offset_of!(MutatorConfig, release_func) - 32usize]; -}; -#[repr(C)] -#[repr(align(8))] -pub struct MMTkMutatorContext { - pub _bindgen_opaque_blob: [u64; 87usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of MMTkMutatorContext"][::std::mem::size_of::() - 696usize]; - ["Alignment of MMTkMutatorContext"][::std::mem::align_of::() - 8usize]; -}; -pub type sig_atomic_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_taggedvalue_bits { - pub _bitfield_align_1: [u64; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_taggedvalue_bits"] - [::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk__jl_taggedvalue_bits"] - [::std::mem::align_of::() - 8usize]; -}; -impl mmtk__jl_taggedvalue_bits { - #[inline] - pub fn gc(&self) -> usize { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u64) } - } - #[inline] - pub fn set_gc(&mut self, val: usize) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 2u8, val as u64) - } - } - #[inline] - pub fn in_image(&self) -> usize { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } - } - #[inline] - pub fn set_in_image(&mut self, val: usize) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn unused(&self) -> usize { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } - } - #[inline] - pub fn set_unused(&mut self, val: usize) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn tag(&self) -> usize { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 60u8) as u64) } - } - #[inline] - pub fn set_tag(&mut self, val: usize) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 60u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - gc: usize, - in_image: usize, - unused: usize, - tag: usize, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 2u8, { - let gc: u64 = unsafe { ::std::mem::transmute(gc) }; - gc as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let in_image: u64 = unsafe { ::std::mem::transmute(in_image) }; - in_image as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let unused: u64 = unsafe { ::std::mem::transmute(unused) }; - unused as u64 - }); - __bindgen_bitfield_unit.set(4usize, 60u8, { - let tag: u64 = unsafe { ::std::mem::transmute(tag) }; - tag as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_value_t { - _unused: [u8; 0], -} -pub type mmtk_jl_value_t = mmtk__jl_value_t; -pub type mmtk_jl_taggedvalue_t = mmtk__jl_taggedvalue_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct mmtk__jl_taggedvalue_t { - pub __bindgen_anon_1: mmtk__jl_taggedvalue_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union mmtk__jl_taggedvalue_t__bindgen_ty_1 { - pub header: usize, - pub next: *mut mmtk_jl_taggedvalue_t, - pub type_: *mut mmtk_jl_value_t, - pub bits: mmtk__jl_taggedvalue_bits, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_taggedvalue_t__bindgen_ty_1"] - [::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk__jl_taggedvalue_t__bindgen_ty_1"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_taggedvalue_t__bindgen_ty_1::header"] - [::std::mem::offset_of!(mmtk__jl_taggedvalue_t__bindgen_ty_1, header) - 0usize]; - ["Offset of field: mmtk__jl_taggedvalue_t__bindgen_ty_1::next"] - [::std::mem::offset_of!(mmtk__jl_taggedvalue_t__bindgen_ty_1, next) - 0usize]; - ["Offset of field: mmtk__jl_taggedvalue_t__bindgen_ty_1::type_"] - [::std::mem::offset_of!(mmtk__jl_taggedvalue_t__bindgen_ty_1, type_) - 0usize]; - ["Offset of field: mmtk__jl_taggedvalue_t__bindgen_ty_1::bits"] - [::std::mem::offset_of!(mmtk__jl_taggedvalue_t__bindgen_ty_1, bits) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_taggedvalue_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk__jl_taggedvalue_t"] - [::std::mem::align_of::() - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_datatype_layout_t { - pub size: u32, - pub nfields: u32, - pub npointers: u32, - pub first_ptr: i32, - pub alignment: u16, - pub flags: mmtk_jl_datatype_layout_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_datatype_layout_t__bindgen_ty_1 { - pub _bitfield_align_1: [u16; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_datatype_layout_t__bindgen_ty_1"] - [::std::mem::size_of::() - 2usize]; - ["Alignment of mmtk_jl_datatype_layout_t__bindgen_ty_1"] - [::std::mem::align_of::() - 2usize]; -}; -impl mmtk_jl_datatype_layout_t__bindgen_ty_1 { - #[inline] - pub fn haspadding(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } - } - #[inline] - pub fn set_haspadding(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn fielddesc_type(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 2u8) as u16) } - } - #[inline] - pub fn set_fielddesc_type(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 2u8, val as u64) - } - } - #[inline] - pub fn arrayelem_isboxed(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } - } - #[inline] - pub fn set_arrayelem_isboxed(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn arrayelem_isunion(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } - } - #[inline] - pub fn set_arrayelem_isunion(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn isbitsegal(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } - } - #[inline] - pub fn set_isbitsegal(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn padding(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 10u8) as u16) } - } - #[inline] - pub fn set_padding(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 10u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - haspadding: u16, - fielddesc_type: u16, - arrayelem_isboxed: u16, - arrayelem_isunion: u16, - isbitsegal: u16, - padding: u16, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let haspadding: u16 = unsafe { ::std::mem::transmute(haspadding) }; - haspadding as u64 - }); - __bindgen_bitfield_unit.set(1usize, 2u8, { - let fielddesc_type: u16 = unsafe { ::std::mem::transmute(fielddesc_type) }; - fielddesc_type as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let arrayelem_isboxed: u16 = unsafe { ::std::mem::transmute(arrayelem_isboxed) }; - arrayelem_isboxed as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let arrayelem_isunion: u16 = unsafe { ::std::mem::transmute(arrayelem_isunion) }; - arrayelem_isunion as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let isbitsegal: u16 = unsafe { ::std::mem::transmute(isbitsegal) }; - isbitsegal as u64 - }); - __bindgen_bitfield_unit.set(6usize, 10u8, { - let padding: u16 = unsafe { ::std::mem::transmute(padding) }; - padding as u64 - }); - __bindgen_bitfield_unit - } -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_datatype_layout_t"] - [::std::mem::size_of::() - 20usize]; - ["Alignment of mmtk_jl_datatype_layout_t"] - [::std::mem::align_of::() - 4usize]; - ["Offset of field: mmtk_jl_datatype_layout_t::size"] - [::std::mem::offset_of!(mmtk_jl_datatype_layout_t, size) - 0usize]; - ["Offset of field: mmtk_jl_datatype_layout_t::nfields"] - [::std::mem::offset_of!(mmtk_jl_datatype_layout_t, nfields) - 4usize]; - ["Offset of field: mmtk_jl_datatype_layout_t::npointers"] - [::std::mem::offset_of!(mmtk_jl_datatype_layout_t, npointers) - 8usize]; - ["Offset of field: mmtk_jl_datatype_layout_t::first_ptr"] - [::std::mem::offset_of!(mmtk_jl_datatype_layout_t, first_ptr) - 12usize]; - ["Offset of field: mmtk_jl_datatype_layout_t::alignment"] - [::std::mem::offset_of!(mmtk_jl_datatype_layout_t, alignment) - 16usize]; - ["Offset of field: mmtk_jl_datatype_layout_t::flags"] - [::std::mem::offset_of!(mmtk_jl_datatype_layout_t, flags) - 18usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_typename_t { - pub name: *mut ::std::os::raw::c_void, - pub module: *mut mmtk__jl_module_t, - pub names: *mut ::std::os::raw::c_void, - pub atomicfields: *const u32, - pub constfields: *const u32, - pub wrapper: *mut ::std::os::raw::c_void, - pub Typeofwrapper: *mut ::std::os::raw::c_void, - pub cache: *mut ::std::os::raw::c_void, - pub linearcache: *mut ::std::os::raw::c_void, - pub mt: *mut ::std::os::raw::c_void, - pub partial: *mut ::std::os::raw::c_void, - pub hash: isize, - pub n_uninitialized: i32, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - pub max_methods: u8, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_typename_t"][::std::mem::size_of::() - 104usize]; - ["Alignment of mmtk_jl_typename_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_typename_t::name"] - [::std::mem::offset_of!(mmtk_jl_typename_t, name) - 0usize]; - ["Offset of field: mmtk_jl_typename_t::module"] - [::std::mem::offset_of!(mmtk_jl_typename_t, module) - 8usize]; - ["Offset of field: mmtk_jl_typename_t::names"] - [::std::mem::offset_of!(mmtk_jl_typename_t, names) - 16usize]; - ["Offset of field: mmtk_jl_typename_t::atomicfields"] - [::std::mem::offset_of!(mmtk_jl_typename_t, atomicfields) - 24usize]; - ["Offset of field: mmtk_jl_typename_t::constfields"] - [::std::mem::offset_of!(mmtk_jl_typename_t, constfields) - 32usize]; - ["Offset of field: mmtk_jl_typename_t::wrapper"] - [::std::mem::offset_of!(mmtk_jl_typename_t, wrapper) - 40usize]; - ["Offset of field: mmtk_jl_typename_t::Typeofwrapper"] - [::std::mem::offset_of!(mmtk_jl_typename_t, Typeofwrapper) - 48usize]; - ["Offset of field: mmtk_jl_typename_t::cache"] - [::std::mem::offset_of!(mmtk_jl_typename_t, cache) - 56usize]; - ["Offset of field: mmtk_jl_typename_t::linearcache"] - [::std::mem::offset_of!(mmtk_jl_typename_t, linearcache) - 64usize]; - ["Offset of field: mmtk_jl_typename_t::mt"] - [::std::mem::offset_of!(mmtk_jl_typename_t, mt) - 72usize]; - ["Offset of field: mmtk_jl_typename_t::partial"] - [::std::mem::offset_of!(mmtk_jl_typename_t, partial) - 80usize]; - ["Offset of field: mmtk_jl_typename_t::hash"] - [::std::mem::offset_of!(mmtk_jl_typename_t, hash) - 88usize]; - ["Offset of field: mmtk_jl_typename_t::n_uninitialized"] - [::std::mem::offset_of!(mmtk_jl_typename_t, n_uninitialized) - 96usize]; - ["Offset of field: mmtk_jl_typename_t::max_methods"] - [::std::mem::offset_of!(mmtk_jl_typename_t, max_methods) - 101usize]; -}; -impl mmtk_jl_typename_t { - #[inline] - pub fn abstract_(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } - } - #[inline] - pub fn set_abstract(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn mutabl(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } - } - #[inline] - pub fn set_mutabl(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn mayinlinealloc(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } - } - #[inline] - pub fn set_mayinlinealloc(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn _reserved(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 5u8) as u8) } - } - #[inline] - pub fn set__reserved(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 5u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - abstract_: u8, - mutabl: u8, - mayinlinealloc: u8, - _reserved: u8, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let abstract_: u8 = unsafe { ::std::mem::transmute(abstract_) }; - abstract_ as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let mutabl: u8 = unsafe { ::std::mem::transmute(mutabl) }; - mutabl as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let mayinlinealloc: u8 = unsafe { ::std::mem::transmute(mayinlinealloc) }; - mayinlinealloc as u64 - }); - __bindgen_bitfield_unit.set(3usize, 5u8, { - let _reserved: u8 = unsafe { ::std::mem::transmute(_reserved) }; - _reserved as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_svec_t { - pub length: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_svec_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk_jl_svec_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_svec_t::length"] - [::std::mem::offset_of!(mmtk_jl_svec_t, length) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_datatype_t { - pub name: *mut mmtk_jl_typename_t, - pub super_: *mut mmtk__jl_datatype_t, - pub parameters: *mut mmtk_jl_svec_t, - pub types: *mut mmtk_jl_svec_t, - pub instance: *mut mmtk_jl_value_t, - pub layout: *const mmtk_jl_datatype_layout_t, - pub hash: u32, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, - pub __bindgen_padding_0: u16, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_datatype_t"][::std::mem::size_of::() - 56usize]; - ["Alignment of mmtk__jl_datatype_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_datatype_t::name"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, name) - 0usize]; - ["Offset of field: mmtk__jl_datatype_t::super_"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, super_) - 8usize]; - ["Offset of field: mmtk__jl_datatype_t::parameters"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, parameters) - 16usize]; - ["Offset of field: mmtk__jl_datatype_t::types"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, types) - 24usize]; - ["Offset of field: mmtk__jl_datatype_t::instance"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, instance) - 32usize]; - ["Offset of field: mmtk__jl_datatype_t::layout"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, layout) - 40usize]; - ["Offset of field: mmtk__jl_datatype_t::hash"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, hash) - 48usize]; -}; -impl mmtk__jl_datatype_t { - #[inline] - pub fn hasfreetypevars(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } - } - #[inline] - pub fn set_hasfreetypevars(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn isconcretetype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } - } - #[inline] - pub fn set_isconcretetype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn isdispatchtuple(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } - } - #[inline] - pub fn set_isdispatchtuple(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn isbitstype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } - } - #[inline] - pub fn set_isbitstype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn zeroinit(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } - } - #[inline] - pub fn set_zeroinit(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn has_concrete_subtype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } - } - #[inline] - pub fn set_has_concrete_subtype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn maybe_subtype_of_cache(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) } - } - #[inline] - pub fn set_maybe_subtype_of_cache(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 1u8, val as u64) - } - } - #[inline] - pub fn isprimitivetype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } - } - #[inline] - pub fn set_isprimitivetype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(7usize, 1u8, val as u64) - } - } - #[inline] - pub fn ismutationfree(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) } - } - #[inline] - pub fn set_ismutationfree(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 1u8, val as u64) - } - } - #[inline] - pub fn isidentityfree(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) } - } - #[inline] - pub fn set_isidentityfree(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(9usize, 1u8, val as u64) - } - } - #[inline] - pub fn smalltag(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 6u8) as u16) } - } - #[inline] - pub fn set_smalltag(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(10usize, 6u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - hasfreetypevars: u16, - isconcretetype: u16, - isdispatchtuple: u16, - isbitstype: u16, - zeroinit: u16, - has_concrete_subtype: u16, - maybe_subtype_of_cache: u16, - isprimitivetype: u16, - ismutationfree: u16, - isidentityfree: u16, - smalltag: u16, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let hasfreetypevars: u16 = unsafe { ::std::mem::transmute(hasfreetypevars) }; - hasfreetypevars as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let isconcretetype: u16 = unsafe { ::std::mem::transmute(isconcretetype) }; - isconcretetype as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let isdispatchtuple: u16 = unsafe { ::std::mem::transmute(isdispatchtuple) }; - isdispatchtuple as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let isbitstype: u16 = unsafe { ::std::mem::transmute(isbitstype) }; - isbitstype as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let zeroinit: u16 = unsafe { ::std::mem::transmute(zeroinit) }; - zeroinit as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let has_concrete_subtype: u16 = unsafe { ::std::mem::transmute(has_concrete_subtype) }; - has_concrete_subtype as u64 - }); - __bindgen_bitfield_unit.set(6usize, 1u8, { - let maybe_subtype_of_cache: u16 = - unsafe { ::std::mem::transmute(maybe_subtype_of_cache) }; - maybe_subtype_of_cache as u64 - }); - __bindgen_bitfield_unit.set(7usize, 1u8, { - let isprimitivetype: u16 = unsafe { ::std::mem::transmute(isprimitivetype) }; - isprimitivetype as u64 - }); - __bindgen_bitfield_unit.set(8usize, 1u8, { - let ismutationfree: u16 = unsafe { ::std::mem::transmute(ismutationfree) }; - ismutationfree as u64 - }); - __bindgen_bitfield_unit.set(9usize, 1u8, { - let isidentityfree: u16 = unsafe { ::std::mem::transmute(isidentityfree) }; - isidentityfree as u64 - }); - __bindgen_bitfield_unit.set(10usize, 6u8, { - let smalltag: u16 = unsafe { ::std::mem::transmute(smalltag) }; - smalltag as u64 - }); - __bindgen_bitfield_unit - } -} -pub type mmtk_jl_datatype_t = mmtk__jl_datatype_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_genericmemory_t { - pub length: usize, - pub ptr: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_genericmemory_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_genericmemory_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_genericmemory_t::length"] - [::std::mem::offset_of!(mmtk_jl_genericmemory_t, length) - 0usize]; - ["Offset of field: mmtk_jl_genericmemory_t::ptr"] - [::std::mem::offset_of!(mmtk_jl_genericmemory_t, ptr) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_genericmemoryref_t { - pub ptr_or_offset: *mut ::std::os::raw::c_void, - pub mem: *mut mmtk_jl_genericmemory_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_genericmemoryref_t"] - [::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_genericmemoryref_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_genericmemoryref_t::ptr_or_offset"] - [::std::mem::offset_of!(mmtk_jl_genericmemoryref_t, ptr_or_offset) - 0usize]; - ["Offset of field: mmtk_jl_genericmemoryref_t::mem"] - [::std::mem::offset_of!(mmtk_jl_genericmemoryref_t, mem) - 8usize]; -}; -#[repr(C)] -#[derive(Debug)] -pub struct mmtk_jl_array_t { - pub ref_: mmtk_jl_genericmemoryref_t, - pub dimsize: __IncompleteArrayField, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_array_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_array_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_array_t::ref_"] - [::std::mem::offset_of!(mmtk_jl_array_t, ref_) - 0usize]; - ["Offset of field: mmtk_jl_array_t::dimsize"] - [::std::mem::offset_of!(mmtk_jl_array_t, dimsize) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_sym_t { - pub left: u64, - pub right: u64, - pub hash: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_sym_t"][::std::mem::size_of::() - 24usize]; - ["Alignment of mmtk__jl_sym_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_sym_t::left"] - [::std::mem::offset_of!(mmtk__jl_sym_t, left) - 0usize]; - ["Offset of field: mmtk__jl_sym_t::right"] - [::std::mem::offset_of!(mmtk__jl_sym_t, right) - 8usize]; - ["Offset of field: mmtk__jl_sym_t::hash"] - [::std::mem::offset_of!(mmtk__jl_sym_t, hash) - 16usize]; -}; -pub type mmtk_jl_sym_t = mmtk__jl_sym_t; -pub type mmtk_jl_ptr_kind_union_t = usize; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_binding_partition_t { - pub restriction: u64, - pub min_world: usize, - pub max_world: u64, - pub next: u64, - pub reserved: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_binding_partition_t"] - [::std::mem::size_of::() - 40usize]; - ["Alignment of mmtk__jl_binding_partition_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_binding_partition_t::restriction"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, restriction) - 0usize]; - ["Offset of field: mmtk__jl_binding_partition_t::min_world"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, min_world) - 8usize]; - ["Offset of field: mmtk__jl_binding_partition_t::max_world"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, max_world) - 16usize]; - ["Offset of field: mmtk__jl_binding_partition_t::next"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, next) - 24usize]; - ["Offset of field: mmtk__jl_binding_partition_t::reserved"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, reserved) - 32usize]; -}; -pub type mmtk_jl_binding_partition_t = mmtk__jl_binding_partition_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_binding_t { - pub globalref: *mut ::std::os::raw::c_void, - pub value: u64, - pub partitions: u64, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - pub __bindgen_padding_0: [u8; 7usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_binding_t"][::std::mem::size_of::() - 32usize]; - ["Alignment of mmtk_jl_binding_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_binding_t::globalref"] - [::std::mem::offset_of!(mmtk_jl_binding_t, globalref) - 0usize]; - ["Offset of field: mmtk_jl_binding_t::value"] - [::std::mem::offset_of!(mmtk_jl_binding_t, value) - 8usize]; - ["Offset of field: mmtk_jl_binding_t::partitions"] - [::std::mem::offset_of!(mmtk_jl_binding_t, partitions) - 16usize]; -}; -impl mmtk_jl_binding_t { - #[inline] - pub fn declared(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } - } - #[inline] - pub fn set_declared(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn exportp(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } - } - #[inline] - pub fn set_exportp(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn publicp(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } - } - #[inline] - pub fn set_publicp(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn deprecated(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 2u8) as u8) } - } - #[inline] - pub fn set_deprecated(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 2u8, val as u64) - } - } - #[inline] - pub fn padding(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u8) } - } - #[inline] - pub fn set_padding(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 3u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - declared: u8, - exportp: u8, - publicp: u8, - deprecated: u8, - padding: u8, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let declared: u8 = unsafe { ::std::mem::transmute(declared) }; - declared as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let exportp: u8 = unsafe { ::std::mem::transmute(exportp) }; - exportp as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let publicp: u8 = unsafe { ::std::mem::transmute(publicp) }; - publicp as u64 - }); - __bindgen_bitfield_unit.set(3usize, 2u8, { - let deprecated: u8 = unsafe { ::std::mem::transmute(deprecated) }; - deprecated as u64 - }); - __bindgen_bitfield_unit.set(5usize, 3u8, { - let padding: u8 = unsafe { ::std::mem::transmute(padding) }; - padding as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_htable_t { - pub size: usize, - pub table: *mut *mut ::std::os::raw::c_void, - pub _space: [*mut ::std::os::raw::c_void; 32usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_htable_t"][::std::mem::size_of::() - 272usize]; - ["Alignment of mmtk_htable_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_htable_t::size"][::std::mem::offset_of!(mmtk_htable_t, size) - 0usize]; - ["Offset of field: mmtk_htable_t::table"] - [::std::mem::offset_of!(mmtk_htable_t, table) - 8usize]; - ["Offset of field: mmtk_htable_t::_space"] - [::std::mem::offset_of!(mmtk_htable_t, _space) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_arraylist_t { - pub len: usize, - pub max: usize, - pub items: *mut *mut ::std::os::raw::c_void, - pub _space: [*mut ::std::os::raw::c_void; 29usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_arraylist_t"][::std::mem::size_of::() - 256usize]; - ["Alignment of mmtk_arraylist_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_arraylist_t::len"] - [::std::mem::offset_of!(mmtk_arraylist_t, len) - 0usize]; - ["Offset of field: mmtk_arraylist_t::max"] - [::std::mem::offset_of!(mmtk_arraylist_t, max) - 8usize]; - ["Offset of field: mmtk_arraylist_t::items"] - [::std::mem::offset_of!(mmtk_arraylist_t, items) - 16usize]; - ["Offset of field: mmtk_arraylist_t::_space"] - [::std::mem::offset_of!(mmtk_arraylist_t, _space) - 24usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_small_arraylist_t { - pub len: u32, - pub max: u32, - pub items: *mut *mut ::std::os::raw::c_void, - pub _space: [*mut ::std::os::raw::c_void; 6usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_small_arraylist_t"][::std::mem::size_of::() - 64usize]; - ["Alignment of mmtk_small_arraylist_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_small_arraylist_t::len"] - [::std::mem::offset_of!(mmtk_small_arraylist_t, len) - 0usize]; - ["Offset of field: mmtk_small_arraylist_t::max"] - [::std::mem::offset_of!(mmtk_small_arraylist_t, max) - 4usize]; - ["Offset of field: mmtk_small_arraylist_t::items"] - [::std::mem::offset_of!(mmtk_small_arraylist_t, items) - 8usize]; - ["Offset of field: mmtk_small_arraylist_t::_space"] - [::std::mem::offset_of!(mmtk_small_arraylist_t, _space) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_uuid_t { - pub hi: u64, - pub lo: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_uuid_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_uuid_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_uuid_t::hi"][::std::mem::offset_of!(mmtk_jl_uuid_t, hi) - 0usize]; - ["Offset of field: mmtk_jl_uuid_t::lo"][::std::mem::offset_of!(mmtk_jl_uuid_t, lo) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_mutex_t { - pub owner: u64, - pub count: u32, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_mutex_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_mutex_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_mutex_t::owner"] - [::std::mem::offset_of!(mmtk_jl_mutex_t, owner) - 0usize]; - ["Offset of field: mmtk_jl_mutex_t::count"] - [::std::mem::offset_of!(mmtk_jl_mutex_t, count) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_module_t { - pub name: *mut ::std::os::raw::c_void, - pub parent: *mut mmtk__jl_module_t, - pub bindings: *mut u64, - pub bindingkeyset: *mut u128, - pub file: *mut ::std::os::raw::c_void, - pub line: i32, - pub usings: mmtk_arraylist_t, - pub build_id: mmtk_jl_uuid_t, - pub uuid: mmtk_jl_uuid_t, - pub counter: u32, - pub nospecialize: i32, - pub optlevel: i8, - pub compile: i8, - pub infer: i8, - pub istopmod: u8, - pub max_methods: i8, - pub lock: mmtk_jl_mutex_t, - pub hash: isize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_module_t"][::std::mem::size_of::() - 376usize]; - ["Alignment of mmtk__jl_module_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_module_t::name"] - [::std::mem::offset_of!(mmtk__jl_module_t, name) - 0usize]; - ["Offset of field: mmtk__jl_module_t::parent"] - [::std::mem::offset_of!(mmtk__jl_module_t, parent) - 8usize]; - ["Offset of field: mmtk__jl_module_t::bindings"] - [::std::mem::offset_of!(mmtk__jl_module_t, bindings) - 16usize]; - ["Offset of field: mmtk__jl_module_t::bindingkeyset"] - [::std::mem::offset_of!(mmtk__jl_module_t, bindingkeyset) - 24usize]; - ["Offset of field: mmtk__jl_module_t::file"] - [::std::mem::offset_of!(mmtk__jl_module_t, file) - 32usize]; - ["Offset of field: mmtk__jl_module_t::line"] - [::std::mem::offset_of!(mmtk__jl_module_t, line) - 40usize]; - ["Offset of field: mmtk__jl_module_t::usings"] - [::std::mem::offset_of!(mmtk__jl_module_t, usings) - 48usize]; - ["Offset of field: mmtk__jl_module_t::build_id"] - [::std::mem::offset_of!(mmtk__jl_module_t, build_id) - 304usize]; - ["Offset of field: mmtk__jl_module_t::uuid"] - [::std::mem::offset_of!(mmtk__jl_module_t, uuid) - 320usize]; - ["Offset of field: mmtk__jl_module_t::counter"] - [::std::mem::offset_of!(mmtk__jl_module_t, counter) - 336usize]; - ["Offset of field: mmtk__jl_module_t::nospecialize"] - [::std::mem::offset_of!(mmtk__jl_module_t, nospecialize) - 340usize]; - ["Offset of field: mmtk__jl_module_t::optlevel"] - [::std::mem::offset_of!(mmtk__jl_module_t, optlevel) - 344usize]; - ["Offset of field: mmtk__jl_module_t::compile"] - [::std::mem::offset_of!(mmtk__jl_module_t, compile) - 345usize]; - ["Offset of field: mmtk__jl_module_t::infer"] - [::std::mem::offset_of!(mmtk__jl_module_t, infer) - 346usize]; - ["Offset of field: mmtk__jl_module_t::istopmod"] - [::std::mem::offset_of!(mmtk__jl_module_t, istopmod) - 347usize]; - ["Offset of field: mmtk__jl_module_t::max_methods"] - [::std::mem::offset_of!(mmtk__jl_module_t, max_methods) - 348usize]; - ["Offset of field: mmtk__jl_module_t::lock"] - [::std::mem::offset_of!(mmtk__jl_module_t, lock) - 352usize]; - ["Offset of field: mmtk__jl_module_t::hash"] - [::std::mem::offset_of!(mmtk__jl_module_t, hash) - 368usize]; -}; -pub type mmtk_jl_module_t = mmtk__jl_module_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_excstack_t { - pub top: usize, - pub reserved_size: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_excstack_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk__jl_excstack_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_excstack_t::top"] - [::std::mem::offset_of!(mmtk__jl_excstack_t, top) - 0usize]; - ["Offset of field: mmtk__jl_excstack_t::reserved_size"] - [::std::mem::offset_of!(mmtk__jl_excstack_t, reserved_size) - 8usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct mmtk__jl_bt_element_t { - pub __bindgen_anon_1: mmtk__jl_bt_element_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union mmtk__jl_bt_element_t__bindgen_ty_1 { - pub uintptr: usize, - pub jlvalue: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_bt_element_t__bindgen_ty_1"] - [::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk__jl_bt_element_t__bindgen_ty_1"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_bt_element_t__bindgen_ty_1::uintptr"] - [::std::mem::offset_of!(mmtk__jl_bt_element_t__bindgen_ty_1, uintptr) - 0usize]; - ["Offset of field: mmtk__jl_bt_element_t__bindgen_ty_1::jlvalue"] - [::std::mem::offset_of!(mmtk__jl_bt_element_t__bindgen_ty_1, jlvalue) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_bt_element_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk__jl_bt_element_t"] - [::std::mem::align_of::() - 8usize]; -}; -pub type mmtk_jl_bt_element_t = mmtk__jl_bt_element_t; -pub type mmtk_jl_excstack_t = mmtk__jl_excstack_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_stack_context_t { - pub uc_mcontext: sigjmp_buf, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_stack_context_t"] - [::std::mem::size_of::() - 200usize]; - ["Alignment of mmtk_jl_stack_context_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_stack_context_t::uc_mcontext"] - [::std::mem::offset_of!(mmtk_jl_stack_context_t, uc_mcontext) - 0usize]; -}; -pub type mmtk__jl_ucontext_t = mmtk_jl_stack_context_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct mmtk_jl_ucontext_t { - pub __bindgen_anon_1: mmtk_jl_ucontext_t__bindgen_ty_1, - pub stkbuf: *mut ::std::os::raw::c_void, - pub bufsz: usize, - pub _bitfield_align_1: [u32; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, - pub __bindgen_padding_0: u32, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union mmtk_jl_ucontext_t__bindgen_ty_1 { - pub ctx: *mut mmtk__jl_ucontext_t, - pub copy_ctx: *mut mmtk_jl_stack_context_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_ucontext_t__bindgen_ty_1"] - [::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk_jl_ucontext_t__bindgen_ty_1"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_ucontext_t__bindgen_ty_1::ctx"] - [::std::mem::offset_of!(mmtk_jl_ucontext_t__bindgen_ty_1, ctx) - 0usize]; - ["Offset of field: mmtk_jl_ucontext_t__bindgen_ty_1::copy_ctx"] - [::std::mem::offset_of!(mmtk_jl_ucontext_t__bindgen_ty_1, copy_ctx) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_ucontext_t"][::std::mem::size_of::() - 32usize]; - ["Alignment of mmtk_jl_ucontext_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_ucontext_t::stkbuf"] - [::std::mem::offset_of!(mmtk_jl_ucontext_t, stkbuf) - 8usize]; - ["Offset of field: mmtk_jl_ucontext_t::bufsz"] - [::std::mem::offset_of!(mmtk_jl_ucontext_t, bufsz) - 16usize]; -}; -impl mmtk_jl_ucontext_t { - #[inline] - pub fn copy_stack(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 31u8) as u32) } - } - #[inline] - pub fn set_copy_stack(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 31u8, val as u64) - } - } - #[inline] - pub fn started(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) } - } - #[inline] - pub fn set_started(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(31usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - copy_stack: ::std::os::raw::c_uint, - started: ::std::os::raw::c_uint, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 31u8, { - let copy_stack: u32 = unsafe { ::std::mem::transmute(copy_stack) }; - copy_stack as u64 - }); - __bindgen_bitfield_unit.set(31usize, 1u8, { - let started: u32 = unsafe { ::std::mem::transmute(started) }; - started as u64 - }); - __bindgen_bitfield_unit - } -} -pub type mmtk_jl_gcframe_t = mmtk__jl_gcframe_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_gcframe_t { - pub nroots: usize, - pub prev: *mut mmtk__jl_gcframe_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_gcframe_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk__jl_gcframe_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_gcframe_t::nroots"] - [::std::mem::offset_of!(mmtk__jl_gcframe_t, nroots) - 0usize]; - ["Offset of field: mmtk__jl_gcframe_t::prev"] - [::std::mem::offset_of!(mmtk__jl_gcframe_t, prev) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_pool_t { - pub freelist: *mut mmtk_jl_taggedvalue_t, - pub newpages: *mut mmtk_jl_taggedvalue_t, - pub osize: u16, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_pool_t"][::std::mem::size_of::() - 24usize]; - ["Alignment of mmtk_jl_gc_pool_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_pool_t::freelist"] - [::std::mem::offset_of!(mmtk_jl_gc_pool_t, freelist) - 0usize]; - ["Offset of field: mmtk_jl_gc_pool_t::newpages"] - [::std::mem::offset_of!(mmtk_jl_gc_pool_t, newpages) - 8usize]; - ["Offset of field: mmtk_jl_gc_pool_t::osize"] - [::std::mem::offset_of!(mmtk_jl_gc_pool_t, osize) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_thread_gc_num_common_t { - pub allocd: u64, - pub pool_live_bytes: u64, - pub malloc: u64, - pub realloc: u64, - pub poolalloc: u64, - pub bigalloc: u64, - pub free_acc: u64, - pub alloc_acc: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_thread_gc_num_common_t"] - [::std::mem::size_of::() - 64usize]; - ["Alignment of mmtk_jl_thread_gc_num_common_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::allocd"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, allocd) - 0usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::pool_live_bytes"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, pool_live_bytes) - 8usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::malloc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, malloc) - 16usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::realloc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, realloc) - 24usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::poolalloc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, poolalloc) - 32usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::bigalloc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, bigalloc) - 40usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::free_acc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, free_acc) - 48usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::alloc_acc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, alloc_acc) - 56usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_thread_heap_common_t { - pub weak_refs: mmtk_small_arraylist_t, - pub live_tasks: mmtk_small_arraylist_t, - pub mallocarrays: *mut _mallocmemory_t, - pub mafreelist: *mut _mallocmemory_t, - pub free_stacks: [mmtk_small_arraylist_t; 16usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_thread_heap_common_t"] - [::std::mem::size_of::() - 1168usize]; - ["Alignment of mmtk_jl_thread_heap_common_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::weak_refs"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, weak_refs) - 0usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::live_tasks"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, live_tasks) - 64usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::mallocarrays"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, mallocarrays) - 128usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::mafreelist"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, mafreelist) - 136usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::free_stacks"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, free_stacks) - 144usize]; -}; -pub type mmtk_jl_thread_t = pthread_t; -#[repr(C)] -#[repr(align(64))] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_ws_queue_t { - pub top: u64, - pub __bindgen_padding_0: [u64; 7usize], - pub bottom: u64, - pub __bindgen_padding_1: [u64; 7usize], - pub array: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_ws_queue_t"][::std::mem::size_of::() - 192usize]; - ["Alignment of mmtk_ws_queue_t"][::std::mem::align_of::() - 64usize]; - ["Offset of field: mmtk_ws_queue_t::top"] - [::std::mem::offset_of!(mmtk_ws_queue_t, top) - 0usize]; - ["Offset of field: mmtk_ws_queue_t::bottom"] - [::std::mem::offset_of!(mmtk_ws_queue_t, bottom) - 64usize]; - ["Offset of field: mmtk_ws_queue_t::array"] - [::std::mem::offset_of!(mmtk_ws_queue_t, array) - 128usize]; -}; -#[repr(C)] -#[repr(align(64))] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_markqueue_t { - pub chunk_queue: mmtk_ws_queue_t, - pub ptr_queue: mmtk_ws_queue_t, - pub reclaim_set: mmtk_arraylist_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_markqueue_t"][::std::mem::size_of::() - 640usize]; - ["Alignment of mmtk_jl_gc_markqueue_t"] - [::std::mem::align_of::() - 64usize]; - ["Offset of field: mmtk_jl_gc_markqueue_t::chunk_queue"] - [::std::mem::offset_of!(mmtk_jl_gc_markqueue_t, chunk_queue) - 0usize]; - ["Offset of field: mmtk_jl_gc_markqueue_t::ptr_queue"] - [::std::mem::offset_of!(mmtk_jl_gc_markqueue_t, ptr_queue) - 192usize]; - ["Offset of field: mmtk_jl_gc_markqueue_t::reclaim_set"] - [::std::mem::offset_of!(mmtk_jl_gc_markqueue_t, reclaim_set) - 384usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_page_stack_t { - pub bottom: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_page_stack_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk_jl_gc_page_stack_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_page_stack_t::bottom"] - [::std::mem::offset_of!(mmtk_jl_gc_page_stack_t, bottom) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_mark_cache_t { - pub perm_scanned_bytes: usize, - pub scanned_bytes: usize, - pub nbig_obj: usize, - pub big_obj: [*mut ::std::os::raw::c_void; 1024usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_mark_cache_t"] - [::std::mem::size_of::() - 8216usize]; - ["Alignment of mmtk_jl_gc_mark_cache_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_mark_cache_t::perm_scanned_bytes"] - [::std::mem::offset_of!(mmtk_jl_gc_mark_cache_t, perm_scanned_bytes) - 0usize]; - ["Offset of field: mmtk_jl_gc_mark_cache_t::scanned_bytes"] - [::std::mem::offset_of!(mmtk_jl_gc_mark_cache_t, scanned_bytes) - 8usize]; - ["Offset of field: mmtk_jl_gc_mark_cache_t::nbig_obj"] - [::std::mem::offset_of!(mmtk_jl_gc_mark_cache_t, nbig_obj) - 16usize]; - ["Offset of field: mmtk_jl_gc_mark_cache_t::big_obj"] - [::std::mem::offset_of!(mmtk_jl_gc_mark_cache_t, big_obj) - 24usize]; -}; -#[repr(C)] -pub struct mmtk_jl_gc_tls_states_t { - pub mmtk_mutator: MMTkMutatorContext, - pub malloc_sz_since_last_poll: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_tls_states_t"] - [::std::mem::size_of::() - 704usize]; - ["Alignment of mmtk_jl_gc_tls_states_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_tls_states_t::mmtk_mutator"] - [::std::mem::offset_of!(mmtk_jl_gc_tls_states_t, mmtk_mutator) - 0usize]; - ["Offset of field: mmtk_jl_gc_tls_states_t::malloc_sz_since_last_poll"] - [::std::mem::offset_of!(mmtk_jl_gc_tls_states_t, malloc_sz_since_last_poll) - 696usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_tls_states_common_t { - pub heap: mmtk_jl_thread_heap_common_t, - pub gc_num: mmtk_jl_thread_gc_num_common_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_tls_states_common_t"] - [::std::mem::size_of::() - 1232usize]; - ["Alignment of mmtk_jl_gc_tls_states_common_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_tls_states_common_t::heap"] - [::std::mem::offset_of!(mmtk_jl_gc_tls_states_common_t, heap) - 0usize]; - ["Offset of field: mmtk_jl_gc_tls_states_common_t::gc_num"] - [::std::mem::offset_of!(mmtk_jl_gc_tls_states_common_t, gc_num) - 1168usize]; -}; -#[repr(C)] -pub struct mmtk__jl_tls_states_t { - pub tid: i16, - pub threadpoolid: i8, - pub rngseed: u64, - pub safepoint: u64, - pub sleep_check_state: u8, - pub gc_state: u8, - pub in_pure_callback: i16, - pub in_finalizer: i16, - pub disable_gc: i16, - pub finalizers_inhibited: ::std::os::raw::c_int, - pub gc_tls: mmtk_jl_gc_tls_states_t, - pub gc_tls_common: mmtk_jl_gc_tls_states_common_t, - pub defer_signal: sig_atomic_t, - pub current_task: u64, - pub next_task: *mut mmtk__jl_task_t, - pub previous_task: *mut mmtk__jl_task_t, - pub root_task: *mut mmtk__jl_task_t, - pub timing_stack: *mut ::std::os::raw::c_void, - pub stackbase: *mut ::std::os::raw::c_void, - pub stacksize: usize, - pub sig_exception: *mut mmtk_jl_value_t, - pub bt_data: *mut mmtk__jl_bt_element_t, - pub bt_size: usize, - pub profiling_bt_buffer: *mut mmtk__jl_bt_element_t, - pub signal_request: u32, - pub io_wait: sig_atomic_t, - pub signal_stack: *mut ::std::os::raw::c_void, - pub signal_stack_size: usize, - pub system_id: mmtk_jl_thread_t, - pub suspend_count: u16, - pub finalizers: mmtk_arraylist_t, - pub previous_exception: *mut _jl_value_t, - pub locks: mmtk_small_arraylist_t, - pub engine_nqueued: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_tls_states_t"][::std::mem::size_of::() - 2448usize]; - ["Alignment of mmtk__jl_tls_states_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_tls_states_t::tid"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, tid) - 0usize]; - ["Offset of field: mmtk__jl_tls_states_t::threadpoolid"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, threadpoolid) - 2usize]; - ["Offset of field: mmtk__jl_tls_states_t::rngseed"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, rngseed) - 8usize]; - ["Offset of field: mmtk__jl_tls_states_t::safepoint"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, safepoint) - 16usize]; - ["Offset of field: mmtk__jl_tls_states_t::sleep_check_state"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, sleep_check_state) - 24usize]; - ["Offset of field: mmtk__jl_tls_states_t::gc_state"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, gc_state) - 25usize]; - ["Offset of field: mmtk__jl_tls_states_t::in_pure_callback"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, in_pure_callback) - 26usize]; - ["Offset of field: mmtk__jl_tls_states_t::in_finalizer"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, in_finalizer) - 28usize]; - ["Offset of field: mmtk__jl_tls_states_t::disable_gc"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, disable_gc) - 30usize]; - ["Offset of field: mmtk__jl_tls_states_t::finalizers_inhibited"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, finalizers_inhibited) - 32usize]; - ["Offset of field: mmtk__jl_tls_states_t::gc_tls"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, gc_tls) - 40usize]; - ["Offset of field: mmtk__jl_tls_states_t::gc_tls_common"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, gc_tls_common) - 744usize]; - ["Offset of field: mmtk__jl_tls_states_t::defer_signal"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, defer_signal) - 1976usize]; - ["Offset of field: mmtk__jl_tls_states_t::current_task"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, current_task) - 1984usize]; - ["Offset of field: mmtk__jl_tls_states_t::next_task"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, next_task) - 1992usize]; - ["Offset of field: mmtk__jl_tls_states_t::previous_task"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, previous_task) - 2000usize]; - ["Offset of field: mmtk__jl_tls_states_t::root_task"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, root_task) - 2008usize]; - ["Offset of field: mmtk__jl_tls_states_t::timing_stack"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, timing_stack) - 2016usize]; - ["Offset of field: mmtk__jl_tls_states_t::stackbase"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, stackbase) - 2024usize]; - ["Offset of field: mmtk__jl_tls_states_t::stacksize"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, stacksize) - 2032usize]; - ["Offset of field: mmtk__jl_tls_states_t::sig_exception"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, sig_exception) - 2040usize]; - ["Offset of field: mmtk__jl_tls_states_t::bt_data"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, bt_data) - 2048usize]; - ["Offset of field: mmtk__jl_tls_states_t::bt_size"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, bt_size) - 2056usize]; - ["Offset of field: mmtk__jl_tls_states_t::profiling_bt_buffer"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, profiling_bt_buffer) - 2064usize]; - ["Offset of field: mmtk__jl_tls_states_t::signal_request"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, signal_request) - 2072usize]; - ["Offset of field: mmtk__jl_tls_states_t::io_wait"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, io_wait) - 2076usize]; - ["Offset of field: mmtk__jl_tls_states_t::signal_stack"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, signal_stack) - 2080usize]; - ["Offset of field: mmtk__jl_tls_states_t::signal_stack_size"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, signal_stack_size) - 2088usize]; - ["Offset of field: mmtk__jl_tls_states_t::system_id"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, system_id) - 2096usize]; - ["Offset of field: mmtk__jl_tls_states_t::suspend_count"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, suspend_count) - 2104usize]; - ["Offset of field: mmtk__jl_tls_states_t::finalizers"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, finalizers) - 2112usize]; - ["Offset of field: mmtk__jl_tls_states_t::previous_exception"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, previous_exception) - 2368usize]; - ["Offset of field: mmtk__jl_tls_states_t::locks"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, locks) - 2376usize]; - ["Offset of field: mmtk__jl_tls_states_t::engine_nqueued"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, engine_nqueued) - 2440usize]; -}; -pub type mmtk_jl_tls_states_t = mmtk__jl_tls_states_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct mmtk__jl_task_t { - pub next: *mut ::std::os::raw::c_void, - pub queue: *mut ::std::os::raw::c_void, - pub tls: *mut ::std::os::raw::c_void, - pub donenotify: *mut ::std::os::raw::c_void, - pub result: *mut ::std::os::raw::c_void, - pub scope: *mut ::std::os::raw::c_void, - pub start: *mut ::std::os::raw::c_void, - pub rngState: [u64; 5usize], - pub _state: u8, - pub sticky: u8, - pub _isexception: u8, - pub priority: u16, - pub tid: u16, - pub threadpoolid: i8, - pub reentrant_timing: u8, - pub gcstack: *mut mmtk_jl_gcframe_t, - pub world_age: usize, - pub ptls: *mut ::std::os::raw::c_void, - pub excstack: *mut mmtk_jl_excstack_t, - pub eh: *mut ::std::os::raw::c_void, - pub ctx: mmtk_jl_ucontext_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_task_t"][::std::mem::size_of::() - 184usize]; - ["Alignment of mmtk__jl_task_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_task_t::next"] - [::std::mem::offset_of!(mmtk__jl_task_t, next) - 0usize]; - ["Offset of field: mmtk__jl_task_t::queue"] - [::std::mem::offset_of!(mmtk__jl_task_t, queue) - 8usize]; - ["Offset of field: mmtk__jl_task_t::tls"] - [::std::mem::offset_of!(mmtk__jl_task_t, tls) - 16usize]; - ["Offset of field: mmtk__jl_task_t::donenotify"] - [::std::mem::offset_of!(mmtk__jl_task_t, donenotify) - 24usize]; - ["Offset of field: mmtk__jl_task_t::result"] - [::std::mem::offset_of!(mmtk__jl_task_t, result) - 32usize]; - ["Offset of field: mmtk__jl_task_t::scope"] - [::std::mem::offset_of!(mmtk__jl_task_t, scope) - 40usize]; - ["Offset of field: mmtk__jl_task_t::start"] - [::std::mem::offset_of!(mmtk__jl_task_t, start) - 48usize]; - ["Offset of field: mmtk__jl_task_t::rngState"] - [::std::mem::offset_of!(mmtk__jl_task_t, rngState) - 56usize]; - ["Offset of field: mmtk__jl_task_t::_state"] - [::std::mem::offset_of!(mmtk__jl_task_t, _state) - 96usize]; - ["Offset of field: mmtk__jl_task_t::sticky"] - [::std::mem::offset_of!(mmtk__jl_task_t, sticky) - 97usize]; - ["Offset of field: mmtk__jl_task_t::_isexception"] - [::std::mem::offset_of!(mmtk__jl_task_t, _isexception) - 98usize]; - ["Offset of field: mmtk__jl_task_t::priority"] - [::std::mem::offset_of!(mmtk__jl_task_t, priority) - 100usize]; - ["Offset of field: mmtk__jl_task_t::tid"] - [::std::mem::offset_of!(mmtk__jl_task_t, tid) - 102usize]; - ["Offset of field: mmtk__jl_task_t::threadpoolid"] - [::std::mem::offset_of!(mmtk__jl_task_t, threadpoolid) - 104usize]; - ["Offset of field: mmtk__jl_task_t::reentrant_timing"] - [::std::mem::offset_of!(mmtk__jl_task_t, reentrant_timing) - 105usize]; - ["Offset of field: mmtk__jl_task_t::gcstack"] - [::std::mem::offset_of!(mmtk__jl_task_t, gcstack) - 112usize]; - ["Offset of field: mmtk__jl_task_t::world_age"] - [::std::mem::offset_of!(mmtk__jl_task_t, world_age) - 120usize]; - ["Offset of field: mmtk__jl_task_t::ptls"] - [::std::mem::offset_of!(mmtk__jl_task_t, ptls) - 128usize]; - ["Offset of field: mmtk__jl_task_t::excstack"] - [::std::mem::offset_of!(mmtk__jl_task_t, excstack) - 136usize]; - ["Offset of field: mmtk__jl_task_t::eh"] - [::std::mem::offset_of!(mmtk__jl_task_t, eh) - 144usize]; - ["Offset of field: mmtk__jl_task_t::ctx"] - [::std::mem::offset_of!(mmtk__jl_task_t, ctx) - 152usize]; -}; -pub type mmtk_jl_task_t = mmtk__jl_task_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_weakref_t { - pub value: *mut mmtk_jl_value_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_weakref_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk_jl_weakref_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_weakref_t::value"] - [::std::mem::offset_of!(mmtk_jl_weakref_t, value) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union mmtk___jl_purity_overrides_t { - pub overrides: mmtk___jl_purity_overrides_t__bindgen_ty_1, - pub bits: u16, -} -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Copy, Clone)] -pub struct mmtk___jl_purity_overrides_t__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk___jl_purity_overrides_t__bindgen_ty_1"] - [::std::mem::size_of::() - 2usize]; - ["Alignment of mmtk___jl_purity_overrides_t__bindgen_ty_1"] - [::std::mem::align_of::() - 2usize]; -}; -impl mmtk___jl_purity_overrides_t__bindgen_ty_1 { - #[inline] - pub fn ipo_consistent(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_consistent(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn ipo_effect_free(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_effect_free(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn ipo_nothrow(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_nothrow(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn ipo_terminates_globally(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_terminates_globally(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn ipo_terminates_locally(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_terminates_locally(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn ipo_notaskstate(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_notaskstate(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn ipo_inaccessiblememonly(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_inaccessiblememonly(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 1u8, val as u64) - } - } - #[inline] - pub fn ipo_noub(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_noub(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(7usize, 1u8, val as u64) - } - } - #[inline] - pub fn ipo_noub_if_noinbounds(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_noub_if_noinbounds(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 1u8, val as u64) - } - } - #[inline] - pub fn ipo_consistent_overlay(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) } - } - #[inline] - pub fn set_ipo_consistent_overlay(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(9usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - ipo_consistent: u16, - ipo_effect_free: u16, - ipo_nothrow: u16, - ipo_terminates_globally: u16, - ipo_terminates_locally: u16, - ipo_notaskstate: u16, - ipo_inaccessiblememonly: u16, - ipo_noub: u16, - ipo_noub_if_noinbounds: u16, - ipo_consistent_overlay: u16, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let ipo_consistent: u16 = unsafe { ::std::mem::transmute(ipo_consistent) }; - ipo_consistent as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let ipo_effect_free: u16 = unsafe { ::std::mem::transmute(ipo_effect_free) }; - ipo_effect_free as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let ipo_nothrow: u16 = unsafe { ::std::mem::transmute(ipo_nothrow) }; - ipo_nothrow as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let ipo_terminates_globally: u16 = - unsafe { ::std::mem::transmute(ipo_terminates_globally) }; - ipo_terminates_globally as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let ipo_terminates_locally: u16 = - unsafe { ::std::mem::transmute(ipo_terminates_locally) }; - ipo_terminates_locally as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let ipo_notaskstate: u16 = unsafe { ::std::mem::transmute(ipo_notaskstate) }; - ipo_notaskstate as u64 - }); - __bindgen_bitfield_unit.set(6usize, 1u8, { - let ipo_inaccessiblememonly: u16 = - unsafe { ::std::mem::transmute(ipo_inaccessiblememonly) }; - ipo_inaccessiblememonly as u64 - }); - __bindgen_bitfield_unit.set(7usize, 1u8, { - let ipo_noub: u16 = unsafe { ::std::mem::transmute(ipo_noub) }; - ipo_noub as u64 - }); - __bindgen_bitfield_unit.set(8usize, 1u8, { - let ipo_noub_if_noinbounds: u16 = - unsafe { ::std::mem::transmute(ipo_noub_if_noinbounds) }; - ipo_noub_if_noinbounds as u64 - }); - __bindgen_bitfield_unit.set(9usize, 1u8, { - let ipo_consistent_overlay: u16 = - unsafe { ::std::mem::transmute(ipo_consistent_overlay) }; - ipo_consistent_overlay as u64 - }); - __bindgen_bitfield_unit - } -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk___jl_purity_overrides_t"] - [::std::mem::size_of::() - 2usize]; - ["Alignment of mmtk___jl_purity_overrides_t"] - [::std::mem::align_of::() - 2usize]; - ["Offset of field: mmtk___jl_purity_overrides_t::overrides"] - [::std::mem::offset_of!(mmtk___jl_purity_overrides_t, overrides) - 0usize]; - ["Offset of field: mmtk___jl_purity_overrides_t::bits"] - [::std::mem::offset_of!(mmtk___jl_purity_overrides_t, bits) - 0usize]; -}; -pub type mmtk__jl_purity_overrides_t = mmtk___jl_purity_overrides_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct mmtk__jl_method_t { - pub name: *mut ::std::os::raw::c_void, - pub module: *mut mmtk__jl_module_t, - pub file: *mut ::std::os::raw::c_void, - pub line: i32, - pub primary_world: usize, - pub deleted_world: usize, - pub sig: *mut ::std::os::raw::c_void, - pub specializations: u64, - pub speckeyset: u64, - pub slot_syms: *mut ::std::os::raw::c_void, - pub external_mt: *mut ::std::os::raw::c_void, - pub source: *mut ::std::os::raw::c_void, - pub debuginfo: *mut ::std::os::raw::c_void, - pub unspecialized: u64, - pub generator: *mut ::std::os::raw::c_void, - pub roots: *mut ::std::os::raw::c_void, - pub root_blocks: *mut ::std::os::raw::c_void, - pub nroots_sysimg: i32, - pub ccallable: *mut ::std::os::raw::c_void, - pub invokes: u64, - pub recursion_relation: *mut ::std::os::raw::c_void, - pub nargs: u32, - pub called: u32, - pub nospecialize: u32, - pub nkw: u32, - pub isva: u8, - pub is_for_opaque_closure: u8, - pub nospecializeinfer: u8, - pub constprop: u8, - pub max_varargs: u8, - pub purity: mmtk__jl_purity_overrides_t, - pub writelock: mmtk_jl_mutex_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_method_t"][::std::mem::size_of::() - 208usize]; - ["Alignment of mmtk__jl_method_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_method_t::name"] - [::std::mem::offset_of!(mmtk__jl_method_t, name) - 0usize]; - ["Offset of field: mmtk__jl_method_t::module"] - [::std::mem::offset_of!(mmtk__jl_method_t, module) - 8usize]; - ["Offset of field: mmtk__jl_method_t::file"] - [::std::mem::offset_of!(mmtk__jl_method_t, file) - 16usize]; - ["Offset of field: mmtk__jl_method_t::line"] - [::std::mem::offset_of!(mmtk__jl_method_t, line) - 24usize]; - ["Offset of field: mmtk__jl_method_t::primary_world"] - [::std::mem::offset_of!(mmtk__jl_method_t, primary_world) - 32usize]; - ["Offset of field: mmtk__jl_method_t::deleted_world"] - [::std::mem::offset_of!(mmtk__jl_method_t, deleted_world) - 40usize]; - ["Offset of field: mmtk__jl_method_t::sig"] - [::std::mem::offset_of!(mmtk__jl_method_t, sig) - 48usize]; - ["Offset of field: mmtk__jl_method_t::specializations"] - [::std::mem::offset_of!(mmtk__jl_method_t, specializations) - 56usize]; - ["Offset of field: mmtk__jl_method_t::speckeyset"] - [::std::mem::offset_of!(mmtk__jl_method_t, speckeyset) - 64usize]; - ["Offset of field: mmtk__jl_method_t::slot_syms"] - [::std::mem::offset_of!(mmtk__jl_method_t, slot_syms) - 72usize]; - ["Offset of field: mmtk__jl_method_t::external_mt"] - [::std::mem::offset_of!(mmtk__jl_method_t, external_mt) - 80usize]; - ["Offset of field: mmtk__jl_method_t::source"] - [::std::mem::offset_of!(mmtk__jl_method_t, source) - 88usize]; - ["Offset of field: mmtk__jl_method_t::debuginfo"] - [::std::mem::offset_of!(mmtk__jl_method_t, debuginfo) - 96usize]; - ["Offset of field: mmtk__jl_method_t::unspecialized"] - [::std::mem::offset_of!(mmtk__jl_method_t, unspecialized) - 104usize]; - ["Offset of field: mmtk__jl_method_t::generator"] - [::std::mem::offset_of!(mmtk__jl_method_t, generator) - 112usize]; - ["Offset of field: mmtk__jl_method_t::roots"] - [::std::mem::offset_of!(mmtk__jl_method_t, roots) - 120usize]; - ["Offset of field: mmtk__jl_method_t::root_blocks"] - [::std::mem::offset_of!(mmtk__jl_method_t, root_blocks) - 128usize]; - ["Offset of field: mmtk__jl_method_t::nroots_sysimg"] - [::std::mem::offset_of!(mmtk__jl_method_t, nroots_sysimg) - 136usize]; - ["Offset of field: mmtk__jl_method_t::ccallable"] - [::std::mem::offset_of!(mmtk__jl_method_t, ccallable) - 144usize]; - ["Offset of field: mmtk__jl_method_t::invokes"] - [::std::mem::offset_of!(mmtk__jl_method_t, invokes) - 152usize]; - ["Offset of field: mmtk__jl_method_t::recursion_relation"] - [::std::mem::offset_of!(mmtk__jl_method_t, recursion_relation) - 160usize]; - ["Offset of field: mmtk__jl_method_t::nargs"] - [::std::mem::offset_of!(mmtk__jl_method_t, nargs) - 168usize]; - ["Offset of field: mmtk__jl_method_t::called"] - [::std::mem::offset_of!(mmtk__jl_method_t, called) - 172usize]; - ["Offset of field: mmtk__jl_method_t::nospecialize"] - [::std::mem::offset_of!(mmtk__jl_method_t, nospecialize) - 176usize]; - ["Offset of field: mmtk__jl_method_t::nkw"] - [::std::mem::offset_of!(mmtk__jl_method_t, nkw) - 180usize]; - ["Offset of field: mmtk__jl_method_t::isva"] - [::std::mem::offset_of!(mmtk__jl_method_t, isva) - 184usize]; - ["Offset of field: mmtk__jl_method_t::is_for_opaque_closure"] - [::std::mem::offset_of!(mmtk__jl_method_t, is_for_opaque_closure) - 185usize]; - ["Offset of field: mmtk__jl_method_t::nospecializeinfer"] - [::std::mem::offset_of!(mmtk__jl_method_t, nospecializeinfer) - 186usize]; - ["Offset of field: mmtk__jl_method_t::constprop"] - [::std::mem::offset_of!(mmtk__jl_method_t, constprop) - 187usize]; - ["Offset of field: mmtk__jl_method_t::max_varargs"] - [::std::mem::offset_of!(mmtk__jl_method_t, max_varargs) - 188usize]; - ["Offset of field: mmtk__jl_method_t::purity"] - [::std::mem::offset_of!(mmtk__jl_method_t, purity) - 190usize]; - ["Offset of field: mmtk__jl_method_t::writelock"] - [::std::mem::offset_of!(mmtk__jl_method_t, writelock) - 192usize]; -}; -pub type mmtk_jl_method_t = mmtk__jl_method_t; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_null_tag: mmtk_jl_small_typeof_tags = 0; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_typeofbottom_tag: mmtk_jl_small_typeof_tags = 1; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag: mmtk_jl_small_typeof_tags = 2; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_unionall_tag: mmtk_jl_small_typeof_tags = 3; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uniontype_tag: mmtk_jl_small_typeof_tags = 4; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_vararg_tag: mmtk_jl_small_typeof_tags = 5; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_tvar_tag: mmtk_jl_small_typeof_tags = 6; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_symbol_tag: mmtk_jl_small_typeof_tags = 7; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_module_tag: mmtk_jl_small_typeof_tags = 8; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_simplevector_tag: mmtk_jl_small_typeof_tags = 9; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_string_tag: mmtk_jl_small_typeof_tags = 10; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_task_tag: mmtk_jl_small_typeof_tags = 11; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_bool_tag: mmtk_jl_small_typeof_tags = 12; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_char_tag: mmtk_jl_small_typeof_tags = 13; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_int16_tag: mmtk_jl_small_typeof_tags = 14; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_int32_tag: mmtk_jl_small_typeof_tags = 15; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_int64_tag: mmtk_jl_small_typeof_tags = 16; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_int8_tag: mmtk_jl_small_typeof_tags = 17; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uint16_tag: mmtk_jl_small_typeof_tags = 18; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uint32_tag: mmtk_jl_small_typeof_tags = 19; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uint64_tag: mmtk_jl_small_typeof_tags = 20; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uint8_tag: mmtk_jl_small_typeof_tags = 21; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_tags_count: mmtk_jl_small_typeof_tags = 22; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_bitstags_first: mmtk_jl_small_typeof_tags = 13; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_max_tags: mmtk_jl_small_typeof_tags = 64; -pub type mmtk_jl_small_typeof_tags = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __locale_data { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _mallocmemory_t { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_value_t { - pub _address: u8, -} diff --git a/mmtk/src/lib.rs b/mmtk/src/lib.rs index c15b49df..bcea23b3 100644 --- a/mmtk/src/lib.rs +++ b/mmtk/src/lib.rs @@ -11,7 +11,6 @@ use mmtk::MMTKBuilder; use mmtk::MMTK; use std::collections::HashMap; -use std::ptr::null_mut; use std::sync::atomic::AtomicIsize; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Condvar, Mutex, RwLock}; @@ -94,30 +93,26 @@ lazy_static! { type ProcessSlotFn = *const extern "C" fn(closure: Address, slot: Address); -#[repr(C)] -pub struct Julia_Upcalls { - pub scan_julia_exc_obj: - extern "C" fn(obj: Address, closure: Address, process_slot: ProcessSlotFn), - pub get_stackbase: extern "C" fn(tid: u16) -> usize, - pub jl_throw_out_of_memory_error: extern "C" fn(), - pub jl_get_gc_disable_counter: extern "C" fn() -> u32, - pub mmtk_sweep_malloced_array: extern "C" fn(), - pub mmtk_sweep_stack_pools: extern "C" fn(), - pub wait_in_a_safepoint: extern "C" fn(), - pub exit_from_safepoint: extern "C" fn(old_state: i8), - pub jl_hrtime: extern "C" fn() -> u64, - pub update_gc_stats: extern "C" fn(u64, usize, bool), - pub get_abi_structs_checksum_c: extern "C" fn() -> usize, - pub get_thread_finalizer_list: extern "C" fn(tls: OpaquePointer) -> Address, - pub get_to_finalize_list: extern "C" fn() -> Address, - pub get_marked_finalizers_list: extern "C" fn() -> Address, - pub arraylist_grow: extern "C" fn(Address, usize), - pub get_jl_gc_have_pending_finalizers: extern "C" fn() -> *mut i32, - pub scan_vm_specific_roots: extern "C" fn(closure: *mut crate::slots::RootsWorkClosure), - pub update_inlined_array: extern "C" fn(to: Address, from: Address), - pub prepare_to_collect: extern "C" fn(), - pub get_owner_address: extern "C" fn(m: Address) -> Address, - pub mmtk_genericmemory_how: extern "C" fn(m: Address) -> usize, +#[allow(improper_ctypes)] +extern "C" { + // these are specific to MMTk and defined in gc-mmtk.c + pub fn jl_mmtk_scan_julia_exc_obj(obj: Address, closure: Address, process_slot: ProcessSlotFn); + pub fn jl_mmtk_get_stackbase(tid: i16) -> usize; + pub fn jl_mmtk_sweep_malloced_memory(); + pub fn jl_mmtk_sweep_stack_pools(); + pub fn jl_mmtk_update_gc_stats(t: u64, mmtk_live_bytes: usize, is_nursery: bool); + pub fn jl_mmtk_get_thread_finalizer_list(tls: OpaquePointer) -> Address; + pub fn jl_mmtk_get_to_finalize_list() -> Address; + pub fn jl_mmtk_get_marked_finalizers_list() -> Address; + pub fn jl_mmtk_get_have_pending_finalizers() -> *mut i32; + pub fn jl_mmtk_scan_vm_specific_roots(closure: *mut crate::slots::RootsWorkClosure); + pub fn jl_mmtk_update_inlined_array(to: Address, from: Address); + pub fn jl_mmtk_prepare_to_collect(); + pub fn jl_mmtk_get_owner_address(m: Address) -> Address; + pub fn jl_mmtk_genericmemory_how(m: Address) -> usize; + // these are already part of the Julia Runtime + pub fn jl_throw_out_of_memory_error(); + pub fn arraylist_grow(a: Address, n: usize); + pub fn jl_get_gc_disable_counter() -> u32; + pub fn jl_hrtime() -> u64; } - -pub static mut UPCALLS: *const Julia_Upcalls = null_mut(); diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index f55d04aa..9a983cb8 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -1,9 +1,10 @@ use crate::api::mmtk_get_obj_size; +use crate::jl_mmtk_genericmemory_how; +use crate::jl_mmtk_update_inlined_array; use crate::julia_scanning::{ - jl_genericmemory_typename, jl_small_typeof, mmtk_jl_genericmemory_how, mmtk_jl_typeof, - mmtk_jl_typetagof, + jl_genericmemory_typename, jl_small_typeof, mmtk_jl_typeof, mmtk_jl_typetagof, }; -use crate::{julia_types::*, UPCALLS}; +use crate::julia_types::*; use crate::{JuliaVM, JULIA_BUFF_TAG, JULIA_HEADER_SIZE}; use log::trace; use mmtk::util::copy::*; @@ -94,7 +95,7 @@ impl ObjectModel for VMObjectModel { let vt = mmtk_jl_typeof(from.to_raw_address()); if (*vt).name == jl_genericmemory_typename { - ((*UPCALLS).update_inlined_array)(from.to_raw_address(), to_obj.to_raw_address()) + jl_mmtk_update_inlined_array(from.to_raw_address(), to_obj.to_raw_address()) } } @@ -186,21 +187,20 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { return mmtk_get_obj_size(object); } - if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_unionall_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_uniontype_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_tvar_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_vararg_tag as usize) << 4) + if vtag_usize == ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_unionall_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_uniontype_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_tvar_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_vararg_tag as usize) << 4) { // these objects have pointers in them, but no other special handling // so we want these to fall through to the end vtag_usize = jl_small_typeof[vtag.as_usize() / std::mem::size_of::
()] as usize; vtag = Address::from_usize(vtag_usize); - } else if vtag_usize < ((mmtk_jl_small_typeof_tags_mmtk_jl_max_tags as usize) << 4) { - if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_simplevector_tag as usize) << 4) { - let length = (*obj_address.to_ptr::()).length as usize; - let dtsz = - length * std::mem::size_of::
() + std::mem::size_of::(); + } else if vtag_usize < ((jl_small_typeof_tags_jl_max_tags as usize) << 4) { + if vtag_usize == ((jl_small_typeof_tags_jl_simplevector_tag as usize) << 4) { + let length = (*obj_address.to_ptr::()).length as usize; + let dtsz = length * std::mem::size_of::
() + std::mem::size_of::(); debug_assert!( dtsz + JULIA_HEADER_SIZE <= 2032, @@ -209,10 +209,8 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { ); return llt_align(dtsz + JULIA_HEADER_SIZE, 16); - } else if vtag_usize - == ((mmtk_jl_small_typeof_tags_mmtk_jl_module_tag as usize) << 4) as usize - { - let dtsz = std::mem::size_of::(); + } else if vtag_usize == ((jl_small_typeof_tags_jl_module_tag as usize) << 4) as usize { + let dtsz = std::mem::size_of::(); debug_assert!( dtsz + JULIA_HEADER_SIZE <= 2032, "size {} greater than minimum!", @@ -220,8 +218,8 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { ); return llt_align(dtsz + JULIA_HEADER_SIZE, 16); - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_task_tag as usize) << 4) { - let dtsz = std::mem::size_of::(); + } else if vtag_usize == ((jl_small_typeof_tags_jl_task_tag as usize) << 4) { + let dtsz = std::mem::size_of::(); debug_assert!( dtsz + JULIA_HEADER_SIZE <= 2032, "size {} greater than minimum!", @@ -229,7 +227,7 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { ); return llt_align(dtsz + JULIA_HEADER_SIZE, 16); - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_string_tag as usize) << 4) { + } else if vtag_usize == ((jl_small_typeof_tags_jl_string_tag as usize) << 4) { let length = object.to_raw_address().load::(); let dtsz = length + std::mem::size_of::() + 1; @@ -254,40 +252,39 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { return llt_align(dtsz + JULIA_HEADER_SIZE, 16); } } else { - let vt = vtag.to_ptr::(); + let vt = vtag.to_ptr::(); let type_tag = mmtk_jl_typetagof(vtag); - if type_tag.as_usize() != ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4) + if type_tag.as_usize() != ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4) || (*vt).smalltag() != 0 { panic!( "GC error (probable corruption) - !jl_is_datatype(vt) = {}; vt->smalltag = {}, vt = {:?}", - type_tag.as_usize() != ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4), - (*(vtag.to_ptr::())).smalltag() != 0, + type_tag.as_usize() != ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4), + (*(vtag.to_ptr::())).smalltag() != 0, vt ); } } let obj_type = mmtk_jl_typeof(obj_address); - let vt = vtag.to_ptr::(); + let vt = vtag.to_ptr::(); assert_eq!(obj_type, vt); if (*vt).name == jl_genericmemory_typename { - let m = obj_address.to_ptr::(); - let how = mmtk_jl_genericmemory_how(m); + let m = obj_address.to_ptr::(); + let how = jl_mmtk_genericmemory_how(obj_address); let res = if how == 0 { - let layout = (*(mmtk_jl_typetagof(obj_address).to_ptr::())).layout; + let layout = (*(mmtk_jl_typetagof(obj_address).to_ptr::())).layout; let mut sz = (*layout).size as usize * (*m).length as usize; if (*layout).flags.arrayelem_isunion() != 0 { sz += (*m).length as usize; } - let dtsz = llt_align(std::mem::size_of::(), 16); + let dtsz = llt_align(std::mem::size_of::(), 16); llt_align(sz + dtsz + JULIA_HEADER_SIZE, 16) } else { - let dtsz = - std::mem::size_of::() + std::mem::size_of::
(); + let dtsz = std::mem::size_of::() + std::mem::size_of::
(); llt_align(dtsz + JULIA_HEADER_SIZE, 16) }; @@ -325,7 +322,7 @@ pub unsafe fn llt_align(size: usize, align: usize) -> usize { } #[inline(always)] -pub unsafe fn mmtk_jl_is_uniontype(t: *const mmtk_jl_datatype_t) -> bool { +pub unsafe fn mmtk_jl_is_uniontype(t: *const jl_datatype_t) -> bool { mmtk_jl_typetagof(Address::from_ptr(t)).as_usize() - == (mmtk_jl_small_typeof_tags_mmtk_jl_uniontype_tag << 4) as usize + == (jl_small_typeof_tags_jl_uniontype_tag << 4) as usize } diff --git a/mmtk/src/reference_glue.rs b/mmtk/src/reference_glue.rs index c7fc8f6f..9805803a 100644 --- a/mmtk/src/reference_glue.rs +++ b/mmtk/src/reference_glue.rs @@ -7,7 +7,7 @@ use mmtk::vm::Finalizable; use mmtk::vm::ReferenceGlue; extern "C" { - pub static jl_nothing: *mut mmtk_jl_value_t; + pub static jl_nothing: *mut jl_value_t; } #[derive(Copy, Clone, Eq, Hash, PartialOrd, PartialEq, Debug)] @@ -36,13 +36,13 @@ impl Finalizable for JuliaFinalizableObject { pub struct VMReferenceGlue {} impl VMReferenceGlue { - fn load_referent_raw(reference: ObjectReference) -> *mut mmtk_jl_value_t { - let reff = reference.to_raw_address().to_ptr::(); + fn load_referent_raw(reference: ObjectReference) -> *mut jl_value_t { + let reff = reference.to_raw_address().to_ptr::(); unsafe { (*reff).value } } - fn set_referent_raw(reference: ObjectReference, referent_raw: *mut mmtk_jl_value_t) { - let reff = reference.to_raw_address().to_mut_ptr::(); + fn set_referent_raw(reference: ObjectReference, referent_raw: *mut jl_value_t) { + let reff = reference.to_raw_address().to_mut_ptr::(); unsafe { (*reff).value = referent_raw; } diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index da721240..91c26e77 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -1,5 +1,5 @@ use crate::slots::JuliaVMSlot; -use crate::{SINGLETON, UPCALLS}; +use crate::SINGLETON; use mmtk::memory_manager; use mmtk::scheduler::*; use mmtk::util::opaque_pointer::*; @@ -13,6 +13,9 @@ use mmtk::vm::VMBinding; use mmtk::Mutator; use mmtk::MMTK; +use crate::jl_mmtk_scan_vm_specific_roots; +use crate::jl_mmtk_sweep_malloced_memory; +use crate::jl_mmtk_sweep_stack_pools; use crate::JuliaVM; pub struct VMScanning {} @@ -49,12 +52,12 @@ impl Scanning for VMScanning { use crate::julia_types::*; use mmtk::util::Address; - let ptls: &mut mmtk__jl_tls_states_t = unsafe { std::mem::transmute(mutator.mutator_tls) }; + let ptls: &mut _jl_tls_states_t = unsafe { std::mem::transmute(mutator.mutator_tls) }; let mut slot_buffer = SlotBuffer { buffer: vec![] }; // need to be tpinned as they're all from the shadow stack let mut node_buffer = vec![]; // Scan thread local from ptls: See gc_queue_thread_local in gc.c - let mut root_scan_task = |task: *const mmtk__jl_task_t, task_is_root: bool| { + let mut root_scan_task = |task: *const _jl_task_t, task_is_root: bool| { if !task.is_null() { unsafe { crate::julia_scanning::mmtk_scan_gcstack(task, &mut slot_buffer); @@ -84,12 +87,12 @@ impl Scanning for VMScanning { while i < ptls.gc_tls_common.heap.live_tasks.len { let mut task_address = Address::from_ptr(ptls.gc_tls_common.heap.live_tasks.items); task_address = task_address.shift::
(i as isize); - let task = unsafe { task_address.load::<*const mmtk_jl_task_t>() }; + let task = unsafe { task_address.load::<*const jl_task_t>() }; root_scan_task(task, false); i += 1; } - root_scan_task(ptls.current_task as *mut mmtk__jl_task_t, true); + root_scan_task(ptls.current_task as *mut _jl_task_t, true); root_scan_task(ptls.next_task, true); root_scan_task(ptls.previous_task, true); if !ptls.previous_exception.is_null() { @@ -150,7 +153,7 @@ impl Scanning for VMScanning { use crate::slots::RootsWorkClosure; let mut roots_closure = RootsWorkClosure::from_roots_work_factory(&mut factory); unsafe { - ((*UPCALLS).scan_vm_specific_roots)(&mut roots_closure as _); + jl_mmtk_scan_vm_specific_roots(&mut roots_closure as _); } } @@ -213,9 +216,9 @@ impl SweepVMSpecific { impl GCWork for SweepVMSpecific { fn do_work(&mut self, _worker: &mut GCWorker, _mmtk: &'static MMTK) { - // call sweep malloced arrays and sweep stack pools from UPCALLS - unsafe { ((*UPCALLS).mmtk_sweep_malloced_array)() } - unsafe { ((*UPCALLS).mmtk_sweep_stack_pools)() } + // call sweep malloced arrays and sweep stack pools + unsafe { jl_mmtk_sweep_malloced_memory() } + unsafe { jl_mmtk_sweep_stack_pools() } self.swept = true; } } diff --git a/mmtk/src/util.rs b/mmtk/src/util.rs index 8ea72b2d..30ef75d4 100644 --- a/mmtk/src/util.rs +++ b/mmtk/src/util.rs @@ -36,51 +36,10 @@ impl RootLabel { } } -const PRINT_STRUCT_SIZE: bool = false; - -macro_rules! print_sizeof { - ($t: ty) => {{ - let sz = std::mem::size_of::<$t>(); - if PRINT_STRUCT_SIZE { - println!("Rust {} = {} bytes", stringify!($t), sz); - } - sz - }}; -} - -pub(crate) fn get_abi_structs_checksum_rust() -> usize { - use crate::julia_types::*; - print_sizeof!(mmtk::Mutator) - ^ print_sizeof!(mmtk__jl_taggedvalue_bits) - ^ print_sizeof!(mmtk_jl_taggedvalue_t) - ^ print_sizeof!(mmtk_jl_datatype_layout_t) - ^ print_sizeof!(mmtk_jl_typename_t) - ^ print_sizeof!(mmtk_jl_svec_t) - ^ print_sizeof!(mmtk_jl_datatype_t) - ^ print_sizeof!(mmtk_jl_array_t) - ^ print_sizeof!(mmtk_jl_sym_t) - ^ print_sizeof!(mmtk_jl_binding_t) - ^ print_sizeof!(mmtk_htable_t) - ^ print_sizeof!(mmtk_arraylist_t) - ^ print_sizeof!(mmtk_jl_uuid_t) - ^ print_sizeof!(mmtk_jl_mutex_t) - ^ print_sizeof!(mmtk_jl_module_t) - ^ print_sizeof!(mmtk_jl_excstack_t) - ^ print_sizeof!(mmtk_jl_bt_element_t) - ^ print_sizeof!(mmtk_jl_stack_context_t) - ^ print_sizeof!(mmtk_jl_ucontext_t) - ^ print_sizeof!(mmtk__jl_gcframe_t) - ^ print_sizeof!(mmtk_jl_task_t) - ^ print_sizeof!(mmtk_jl_weakref_t) - ^ print_sizeof!(mmtk_jl_tls_states_t) - ^ print_sizeof!(mmtk_jl_thread_heap_common_t) - ^ print_sizeof!(mmtk_jl_thread_gc_num_common_t) -} - // The functions below allow accessing the values of bitfields without performing a for loop -use crate::julia_types::{__BindgenBitfieldUnit, mmtk_jl_datatype_layout_t, mmtk_jl_ucontext_t}; +use crate::julia_types::{__BindgenBitfieldUnit, jl_datatype_layout_t, jl_ucontext_t}; -impl mmtk_jl_datatype_layout_t { +impl jl_datatype_layout_t { #[inline] pub fn fielddesc_type_custom(&self) -> u16 { let fielddesc_type_raw: u16 = unsafe { @@ -92,7 +51,7 @@ impl mmtk_jl_datatype_layout_t { } } -impl mmtk_jl_ucontext_t { +impl jl_ucontext_t { #[inline] pub fn copy_stack_custom(&self) -> u32 { let copy_stack_raw: u32 = unsafe { @@ -114,7 +73,7 @@ pub extern "C" fn mmtk_julia_copy_stack_check(c_flag_is_defined: bool) { } #[no_mangle] -pub extern "C" fn mmtk_get_possibly_forwared(object: ObjectReference) -> ObjectReference { +pub extern "C" fn mmtk_get_possibly_forwarded(object: ObjectReference) -> ObjectReference { match object.get_forwarded_object() { Some(forwarded) => forwarded, None => object,