diff --git a/.github/scripts/ci-test-patching.sh b/.github/scripts/ci-test-patching.sh index 843aeb93..192feef1 100755 --- a/.github/scripts/ci-test-patching.sh +++ b/.github/scripts/ci-test-patching.sh @@ -38,11 +38,17 @@ declare -a tests_to_skip=( '@test !live_bytes_has_grown_too_much' "$JULIA_PATH/test/gc.jl" '@test any(page_utilization .> 0)' "$JULIA_PATH/test/gc.jl" + # Tests that check the reasons for a full sweep and are specific to stock Julia + '@test reasons\[:FULL_SWEEP_REASON_FORCED_FULL_SWEEP\] >= 1' "$JULIA_PATH/test/gc.jl" + '@test keys(reasons) == Set(Base.FULL_SWEEP_REASONS)' "$JULIA_PATH/test/gc.jl" + # Allocation profiler tests that fail when we inline fastpath allocation '@test length(\[a for a in prof.allocs if a.type == MyType\]) >= 1' "$JULIA_PATH/stdlib/Profile/test/allocs.jl" '@test length(prof.allocs) >= 1' "$JULIA_PATH/stdlib/Profile/test/allocs.jl" '@test length(filter(a->a.type <: type, profile.allocs)) >= NUM_TASKS' "$JULIA_PATH/stdlib/Profile/test/allocs.jl" - + + # Test that expects information from heap snapshot which is currently not available in MMTk + '@test contains(sshot, "redact_this")' "$JULIA_PATH/stdlib/Profile/test/runtests.jl" # This test checks GC logging '@test occursin("GC: pause", read(tmppath, String))' "$JULIA_PATH/test/misc.jl" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8341d3e5..1b5e7cca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: - master - v1.8.2\+RAI - v1.9.2\+RAI + - dev concurrency: # Cancels pending runs when a PR gets updated. diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index 3244d5d7..ed7cd44e 100644 --- a/julia/mmtk_julia.c +++ b/julia/mmtk_julia.c @@ -1,12 +1,13 @@ #include "mmtk_julia.h" #include "mmtk.h" +#include "gc-mmtk.h" #include "mmtk_julia_types.h" #include #include -#include "gc.h" +#include "gc-common.h" +#include "threading.h" extern int64_t perm_scanned_bytes; -extern gc_heapstatus_t gc_heap_stats; 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; @@ -14,13 +15,10 @@ 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 void jl_gc_free_memory(jl_value_t *v, int isaligned); 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 void mmtk_store_obj_size_c(void* obj, size_t size); -extern void jl_gc_free_array(jl_array_t *a); 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); @@ -29,6 +27,8 @@ 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); @@ -46,62 +46,21 @@ JL_DLLEXPORT void (jl_mmtk_harness_end)(void) mmtk_harness_end(); } -JL_DLLEXPORT jl_value_t *jl_mmtk_gc_alloc_default(jl_ptls_t ptls, int osize, size_t align, void *ty) +// 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 { - // safepoint - jl_gc_safepoint_(ptls); - - jl_value_t *v; - if ((uintptr_t)ty != jl_buff_tag) { - // v needs to be 16 byte aligned, therefore v_tagged needs to be offset accordingly to consider the size of header - jl_taggedvalue_t *v_tagged = (jl_taggedvalue_t *)mmtk_immix_alloc_fast(&ptls->mmtk_mutator, LLT_ALIGN(osize, align), align, sizeof(jl_taggedvalue_t)); - v = jl_valueof(v_tagged); - mmtk_immix_post_alloc_fast(&ptls->mmtk_mutator, v, LLT_ALIGN(osize, align)); - } else { - // allocating an extra word to store the size of buffer objects - jl_taggedvalue_t *v_tagged = (jl_taggedvalue_t *)mmtk_immix_alloc_fast(&ptls->mmtk_mutator, LLT_ALIGN(osize+sizeof(jl_taggedvalue_t), align), align, 0); - jl_value_t* v_tagged_aligned = ((jl_value_t*)((char*)(v_tagged) + sizeof(jl_taggedvalue_t))); - v = jl_valueof(v_tagged_aligned); - mmtk_store_obj_size_c(v, LLT_ALIGN(osize+sizeof(jl_taggedvalue_t), align)); - mmtk_immix_post_alloc_fast(&ptls->mmtk_mutator, v, LLT_ALIGN(osize+sizeof(jl_taggedvalue_t), align)); - } - - ptls->gc_tls.gc_num.allocd += osize; - ptls->gc_tls.gc_num.poolalloc++; - - return v; -} - -JL_DLLEXPORT jl_value_t *jl_mmtk_gc_alloc_big(jl_ptls_t ptls, size_t sz) -{ - // safepoint - jl_gc_safepoint_(ptls); - - size_t offs = offsetof(bigval_t, header); - assert(sz >= sizeof(jl_taggedvalue_t) && "sz must include tag"); - static_assert(offsetof(bigval_t, header) >= sizeof(void*), "Empty bigval header?"); - static_assert(sizeof(bigval_t) % JL_HEAP_ALIGNMENT == 0, ""); - size_t allocsz = LLT_ALIGN(sz + offs, JL_CACHE_BYTE_ALIGNMENT); - if (allocsz < sz) { // overflow in adding offs, size was "negative" - assert(0 && "Error when allocating big object"); - jl_throw(jl_memory_exception); - } - - bigval_t *v = (bigval_t*)mmtk_alloc_large(&ptls->mmtk_mutator, allocsz, JL_CACHE_BYTE_ALIGNMENT, 0, 2); - - if (v == NULL) { - assert(0 && "Allocation failed"); - jl_throw(jl_memory_exception); - } - v->sz = allocsz; - - ptls->gc_tls.gc_num.allocd += allocsz; - ptls->gc_tls.gc_num.bigalloc++; - - jl_value_t *result = jl_valueof(&v->header); - mmtk_post_alloc(&ptls->mmtk_mutator, result, allocsz, 2); - - return result; + 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 @@ -109,10 +68,10 @@ 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) { - mallocarray_t *ma = ptls2->gc_tls.heap.mallocarrays; - mallocarray_t **pma = &ptls2->gc_tls.heap.mallocarrays; + mallocmemory_t *ma = ptls2->gc_tls_common.heap.mallocarrays; + mallocmemory_t **pma = &ptls2->gc_tls_common.heap.mallocarrays; while (ma != NULL) { - mallocarray_t *nxt = ma->next; + 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; @@ -121,7 +80,7 @@ static void mmtk_sweep_malloced_memory(void) JL_NOTSAFEPOINT } if (mmtk_is_live_object(a)) { // if the array has been forwarded, the reference needs to be updated - jl_value_t *maybe_forwarded = (jl_value_t*)mmtk_get_possibly_forwared(ma->a); + jl_genericmemory_t *maybe_forwarded = (jl_genericmemory_t*)mmtk_get_possibly_forwared(ma->a); ma->a = maybe_forwarded; pma = &ma->next; } @@ -129,8 +88,8 @@ static void mmtk_sweep_malloced_memory(void) JL_NOTSAFEPOINT *pma = nxt; int isaligned = (uintptr_t)ma->a & 1; jl_gc_free_memory(a, isaligned); - ma->next = ptls2->gc_tls.heap.mafreelist; - ptls2->gc_tls.heap.mafreelist = ma; + ma->next = ptls2->gc_tls_common.heap.mafreelist; + ptls2->gc_tls_common.heap.mafreelist = ma; } ma = nxt; } @@ -160,8 +119,8 @@ JL_DLLEXPORT void jl_gc_prepare_to_collect(void) 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.gc_num.allocd) + gc_num.interval; - jl_atomic_store_relaxed(&ptls->gc_tls.gc_num.allocd, -(int64_t)gc_num.interval); + 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; @@ -417,7 +376,7 @@ void mmtk_sweep_stack_pools(void) // 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.heap.free_stacks[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 @@ -439,10 +398,10 @@ void mmtk_sweep_stack_pools(void) } } if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) { - small_arraylist_free(ptls2->gc_tls.heap.free_stacks); + small_arraylist_free(ptls2->gc_tls_common.heap.free_stacks); } - small_arraylist_t *live_tasks = &ptls2->gc_tls.heap.live_tasks; + 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; @@ -456,16 +415,16 @@ void mmtk_sweep_stack_pools(void) live_tasks->items[n] = maybe_forwarded; t = maybe_forwarded; assert(jl_is_task(t)); - if (t->stkbuf == NULL) + if (t->ctx.stkbuf == NULL) ndel++; // jl_release_task_stack called else n++; } else { ndel++; - void *stkbuf = t->stkbuf; - size_t bufsz = t->bufsz; + void *stkbuf = t->ctx.stkbuf; + size_t bufsz = t->ctx.bufsz; if (stkbuf) { - t->stkbuf = NULL; + t->ctx.stkbuf = NULL; _jl_free_stack(ptls2, stkbuf, bufsz); } #ifdef _COMPILER_TSAN_ENABLED_ @@ -577,14 +536,15 @@ uintptr_t get_abi_structs_checksum_c(void) { ^ 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_t) - ^ print_sizeof(mmtk_jl_thread_gc_num_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, diff --git a/julia/mmtk_julia.h b/julia/mmtk_julia.h index 9ddb6b3e..6c8c80d5 100644 --- a/julia/mmtk_julia.h +++ b/julia/mmtk_julia.h @@ -1,5 +1,5 @@ #include "mmtk.h" -#include "gc.h" +#include "gc-common.h" extern Julia_Upcalls mmtk_upcalls; diff --git a/julia/mmtk_julia_types.h b/julia/mmtk_julia_types.h index 8061e5d5..3bc7a03f 100644 --- a/julia/mmtk_julia_types.h +++ b/julia/mmtk_julia_types.h @@ -5,6 +5,11 @@ #include #include #include "mmtkMutator.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif #if defined(_CPU_X86_64_) # define _P64 @@ -169,18 +174,52 @@ typedef struct mmtk__jl_sym_t { // 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; - void* globalref; // cached GlobalRef for this binding - struct mmtk__jl_binding_t* owner; // for individual imported bindings -- TODO: make _Atomic - _Atomic(void*) ty; // binding type - uint8_t constp:1; - uint8_t exportp:1; + _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 imported:1; - uint8_t usingfailed:1; uint8_t deprecated:2; // 0=not deprecated, 1=renamed, 2=moved to another package - uint8_t padding:1; + uint8_t padding:3; } mmtk_jl_binding_t; #define HT_N_INLINE 32 @@ -224,6 +263,8 @@ typedef struct mmtk__jl_module_t { 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; @@ -278,17 +319,6 @@ extern void siglongjmp (sigjmp_buf __env, int __val) #endif /* Use POSIX. */ # define mmtk_jl_jmp_buf sigjmp_buf -# if defined(_CPU_ARM_) || defined(_CPU_PPC_) || defined(_CPU_WASM_) -# define MAX_ALIGN 8 -# elif defined(_CPU_AARCH64_) -// int128 is 16 bytes aligned on aarch64 -# define MAX_ALIGN 16 -# elif defined(_P64) -// Generically we assume MAX_ALIGN is sizeof(void*) -# define MAX_ALIGN 8 -# else -# define MAX_ALIGN 4 -# endif typedef struct { mmtk_jl_jmp_buf uc_mcontext; @@ -298,9 +328,13 @@ 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; + 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 @@ -332,7 +366,7 @@ typedef struct { _Atomic(uint64_t) bigalloc; _Atomic(int64_t) free_acc; _Atomic(uint64_t) alloc_acc; -} mmtk_jl_thread_gc_num_t; +} mmtk_jl_thread_gc_num_common_t; typedef struct { // variable for tracking weak references @@ -342,23 +376,12 @@ typedef struct { mmtk_small_arraylist_t live_tasks; // variables for tracking malloc'd arrays - struct _mallocarray_t *mallocarrays; - struct _mallocarray_t *mafreelist; - - // variables for tracking big objects - struct _bigval_t *big_objects; - - // lower bound of the number of pointers inside remembered values - int remset_nptr; - mmtk_arraylist_t remset; - - // variables for allocating objects from pools -#define JL_GC_N_MAX_POOLS 51 // conservative. must be kept in sync with `src/julia_internal.h` - mmtk_jl_gc_pool_t norm_pools[JL_GC_N_MAX_POOLS]; + 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_t; +} mmtk_jl_thread_heap_common_t; // handle to reference an OS thread typedef pthread_t mmtk_jl_thread_t; @@ -400,15 +423,15 @@ typedef struct { } mmtk_jl_gc_mark_cache_t; typedef struct { - mmtk_jl_thread_heap_t heap; - mmtk_jl_gc_page_stack_t page_metadata_allocd; - mmtk_jl_thread_gc_num_t gc_num; - mmtk_jl_gc_markqueue_t mark_queue; - mmtk_jl_gc_mark_cache_t gc_cache; - _Atomic(size_t) gc_sweeps_requested; - mmtk_arraylist_t sweep_objs; + 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; @@ -440,6 +463,7 @@ typedef struct mmtk__jl_tls_states_t { // 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; @@ -448,11 +472,6 @@ typedef struct mmtk__jl_tls_states_t { void *timing_stack; void *stackbase; size_t stacksize; - union { - mmtk__jl_ucontext_t base_ctx; // base context of stack - // This hack is needed to support always_copy_stacks: - mmtk_jl_stack_context_t copy_stack_ctx; - }; // 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. @@ -485,8 +504,6 @@ typedef struct mmtk__jl_tls_states_t { // uint64_t sleep_enter; // uint64_t sleep_leave; // ) - MMTkMutatorContext mmtk_mutator; - size_t malloc_sz_since_last_poll; // some hidden state (usually just because we don't have the type's size declaration) } mmtk_jl_tls_states_t; @@ -529,10 +546,6 @@ typedef struct mmtk__jl_task_t { void *eh; // saved thread state mmtk_jl_ucontext_t 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; } mmtk_jl_task_t; typedef struct { @@ -668,4 +681,8 @@ enum mmtk_jl_small_typeof_tags { 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 -}; \ No newline at end of file +}; + +#ifdef __cplusplus +} +#endif diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 0f73770f..85821cc5 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,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 = "d98aa333178d372d96f3c99c712edf0018a50289" +julia_version = "d3f4808ffec79a2b9cac1cc26f90eec48741166b" [lib] crate-type = ["cdylib"] diff --git a/mmtk/api/mmtk.h b/mmtk/api/mmtk.h index 80b10e37..247b5e4a 100644 --- a/mmtk/api/mmtk.h +++ b/mmtk/api/mmtk.h @@ -73,6 +73,7 @@ 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); diff --git a/mmtk/rust-toolchain b/mmtk/rust-toolchain index 883bde30..ef8b0923 100644 --- a/mmtk/rust-toolchain +++ b/mmtk/rust-toolchain @@ -1 +1 @@ -1.71.1 \ No newline at end of file +1.77.0 \ No newline at end of file diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index 9eeb1962..1fb6fa5b 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -5,16 +5,12 @@ use mmtk::util::alloc::AllocationError; use mmtk::util::opaque_pointer::*; use mmtk::vm::{Collection, GCThreadContext}; use mmtk::Mutator; -use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicU32, AtomicU64, Ordering}; +use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicU64, Ordering}; use crate::{BLOCK_FOR_GC, STW_COND, WORLD_HAS_STOPPED}; static GC_START: AtomicU64 = AtomicU64::new(0); -extern "C" { - pub static jl_gc_disable_counter: AtomicU32; -} - pub struct VMCollection {} impl Collection for VMCollection { @@ -109,7 +105,7 @@ impl Collection for VMCollection { } fn is_collection_enabled() -> bool { - unsafe { AtomicU32::load(&jl_gc_disable_counter, Ordering::SeqCst) <= 0 } + unsafe { ((*UPCALLS).jl_get_gc_disable_counter)() <= 0 } } } diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index 3d53270c..d87ac27f 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -27,7 +27,8 @@ extern "C" { 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 mut ijl_small_typeof: [*mut mmtk_jl_datatype_t; 128usize]; + pub static jl_binding_partition_type: *const mmtk_jl_datatype_t; + pub static mut jl_small_typeof: [*mut mmtk_jl_datatype_t; 128usize]; } #[inline(always)] @@ -49,7 +50,7 @@ pub unsafe fn mmtk_jl_typeof(addr: Address) -> *const mmtk_jl_datatype_t { pub unsafe fn mmtk_jl_to_typeof(t: Address) -> *const mmtk_jl_datatype_t { let t_raw = t.as_usize(); if t_raw < (JL_MAX_TAGS << 4) { - let ty = ijl_small_typeof[t_raw / std::mem::size_of::
()]; + let ty = jl_small_typeof[t_raw / std::mem::size_of::
()]; return ty; } return t.to_ptr::(); @@ -87,7 +88,7 @@ pub unsafe fn scan_julia_object>(obj: Address, clos { // these objects have pointers in them, but no other special handling // so we want these to fall through to the end - vtag_usize = ijl_small_typeof[vtag.as_usize() / std::mem::size_of::
()] as usize; + 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) { // these objects either have specialing handling @@ -308,6 +309,15 @@ pub unsafe fn scan_julia_object>(obj: Address, clos if npointers == 0 { return; } else { + if vt == jl_binding_partition_type { + let bpart_ptr = obj.to_mut_ptr::(); + let restriction = (*bpart_ptr).restriction; + 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 { + process_offset_slot(closure, slot, offset); + } + } debug_assert!( (*layout).nfields > 0 && (*layout).fielddesc_type_custom() != 3, "opaque types should have been handled specially" @@ -379,12 +389,12 @@ pub unsafe fn mmtk_scan_gcstack>( ta: *const mmtk_jl_task_t, closure: &mut EV, ) { - let stkbuf = (*ta).stkbuf; - let copy_stack = (*ta).copy_stack_custom(); + let stkbuf = (*ta).ctx.stkbuf; + let copy_stack = (*ta).ctx.copy_stack_custom(); #[cfg(feature = "julia_copy_stack")] if stkbuf != std::ptr::null_mut() && copy_stack != 0 { - let stkbuf_slot = Address::from_ptr(::std::ptr::addr_of!((*ta).stkbuf)); + let stkbuf_slot = Address::from_ptr(::std::ptr::addr_of!((*ta).ctx.stkbuf)); process_slot(closure, stkbuf_slot); } @@ -398,8 +408,8 @@ pub unsafe fn mmtk_scan_gcstack>( } let stackbase = ((*UPCALLS).get_stackbase)((*ta).tid); ub = stackbase as u64; - lb = ub - ((*ta).copy_stack() as u64); - offset = (*ta).stkbuf as isize - lb as isize; + lb = ub - ((*ta).ctx.copy_stack() as u64); + offset = (*ta).ctx.stkbuf as isize - lb as isize; } if s != std::ptr::null_mut() { @@ -522,42 +532,26 @@ pub fn process_slot>(closure: &mut EV, slot: Addres closure.visit_slot(JuliaVMSlot::Simple(simple_slot)); } -// #[inline(always)] -// pub unsafe fn boot_image_object_has_been_scanned(obj: Address) -> u8 { -// let obj_type_addr = mmtk_jl_typeof(obj); -// let obj_type = obj_type_addr.to_ptr::(); - -// if obj_type == jl_symbol_type { -// return 1; -// } - -// if BI_METADATA_START_ALIGNED_DOWN == 0 { -// return 0; -// } - -// if obj.as_usize() < BI_METADATA_START_ALIGNED_DOWN -// || obj.as_usize() >= BI_METADATA_END_ALIGNED_UP -// { -// return 0; -// } - -// return check_metadata_scanned(obj); -// } +// This is based on the function decode_restriction_value from julia_internal.h. +// 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 { + #[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; + } -// #[inline(always)] -// pub unsafe fn boot_image_mark_object_as_scanned(obj: Address) { -// if BI_METADATA_START_ALIGNED_DOWN == 0 { -// return; -// } - -// if obj.as_usize() < BI_METADATA_START_ALIGNED_DOWN -// || obj.as_usize() >= BI_METADATA_END_ALIGNED_UP -// { -// return; -// } - -// mark_metadata_scanned(obj); -// } + #[cfg(not(target_pointer_width = "64"))] + { + // when not #ifdef _P64 we simply return pku.val + // i.e., the offset is 0, since val is the first field + return 0; + } +} #[inline(always)] pub fn process_offset_slot>( diff --git a/mmtk/src/julia_types.rs b/mmtk/src/julia_types.rs index 3f8cdf69..e38d1831 100644 --- a/mmtk/src/julia_types.rs +++ b/mmtk/src/julia_types.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.70.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -398,11 +398,11 @@ 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 MAX_ALIGN: u32 = 4; -pub const JL_GC_N_MAX_POOLS: u32 = 51; pub const JL_N_STACK_POOLS: u32 = 16; pub const JL_GC_STATE_UNSAFE: u32 = 0; pub const JL_GC_STATE_WAITING: u32 = 1; @@ -416,31 +416,12 @@ pub type __jmp_buf = [::std::os::raw::c_long; 8usize]; pub struct __sigset_t { pub __val: [::std::os::raw::c_ulong; 16usize], } -#[test] -fn bindgen_test_layout___sigset_t() { - const UNINIT: ::std::mem::MaybeUninit<__sigset_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sigset_t>(), - 128usize, - concat!("Size of: ", stringify!(__sigset_t)) - ); - assert_eq!( - ::std::mem::align_of::<__sigset_t>(), - 8usize, - concat!("Alignment of ", stringify!(__sigset_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sigset_t), - "::", - stringify!(__val) - ) - ); -} +#[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 { @@ -448,51 +429,17 @@ pub struct __jmp_buf_tag { pub __mask_was_saved: ::std::os::raw::c_int, pub __saved_mask: __sigset_t, } -#[test] -fn bindgen_test_layout___jmp_buf_tag() { - const UNINIT: ::std::mem::MaybeUninit<__jmp_buf_tag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__jmp_buf_tag>(), - 200usize, - concat!("Size of: ", stringify!(__jmp_buf_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__jmp_buf_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__jmp_buf_tag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__jmpbuf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__jmp_buf_tag), - "::", - stringify!(__jmpbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__mask_was_saved) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(__jmp_buf_tag), - "::", - stringify!(__mask_was_saved) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__saved_mask) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__jmp_buf_tag), - "::", - stringify!(__saved_mask) - ) - ); -} +#[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; @@ -555,31 +502,12 @@ pub type __pid_t = ::std::os::raw::c_int; pub struct __fsid_t { pub __val: [::std::os::raw::c_int; 2usize], } -#[test] -fn bindgen_test_layout___fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) - ); -} +#[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; @@ -633,72 +561,26 @@ pub struct timespec { pub tv_sec: __time_t, pub tv_nsec: __syscall_slong_t, } -#[test] -fn bindgen_test_layout_timespec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(timespec)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(timespec)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_nsec) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_sched_param() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(sched_param)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(sched_param)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sched_param), - "::", - stringify!(sched_priority) - ) - ); -} +#[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< @@ -734,31 +616,12 @@ pub type __cpu_mask = ::std::os::raw::c_ulong; pub struct cpu_set_t { pub __bits: [__cpu_mask; 16usize], } -#[test] -fn bindgen_test_layout_cpu_set_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(cpu_set_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(cpu_set_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__bits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(cpu_set_t), - "::", - stringify!(__bits) - ) - ); -} +#[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; } @@ -816,41 +679,13 @@ pub struct timeval { pub tv_sec: __time_t, pub tv_usec: __suseconds_t, } -#[test] -fn bindgen_test_layout_timeval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(timeval)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(timeval)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_usec) - ) - ); -} +#[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 { @@ -877,221 +712,31 @@ pub struct timex { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 44usize]>, } -#[test] -fn bindgen_test_layout_timex() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 208usize, - concat!("Size of: ", stringify!(timex)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(timex)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).modes) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(modes) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).freq) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(freq) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).maxerror) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(maxerror) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).esterror) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(esterror) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).status) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).constant) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(constant) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).precision) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(precision) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tolerance) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(tolerance) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(time) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tick) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(tick) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ppsfreq) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(ppsfreq) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jitter) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(jitter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).shift) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(shift) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stabil) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(stabil) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jitcnt) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(jitcnt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).calcnt) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(calcnt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).errcnt) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(errcnt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stbcnt) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(stbcnt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tai) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(timex), - "::", - stringify!(tai) - ) - ); -} +#[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; } @@ -1111,131 +756,22 @@ pub struct tm { pub tm_gmtoff: ::std::os::raw::c_long, pub tm_zone: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_tm() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(tm)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(tm)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_sec) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_min) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_hour) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_mday) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_mon) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_year) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_wday) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_yday) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_isdst) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_gmtoff) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(tm), - "::", - stringify!(tm_zone) - ) - ); -} +#[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)] @@ -1244,41 +780,15 @@ pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, } -#[test] -fn bindgen_test_layout_itimerspec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(itimerspec)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(itimerspec)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(itimerspec), - "::", - stringify!(it_interval) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(itimerspec), - "::", - stringify!(it_value) - ) - ); -} +#[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 { @@ -1293,71 +803,21 @@ pub struct __locale_struct { pub __ctype_toupper: *const ::std::os::raw::c_int, pub __names: [*const ::std::os::raw::c_char; 13usize], } -#[test] -fn bindgen_test_layout___locale_struct() { - const UNINIT: ::std::mem::MaybeUninit<__locale_struct> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__locale_struct>(), - 232usize, - concat!("Size of: ", stringify!(__locale_struct)) - ); - assert_eq!( - ::std::mem::align_of::<__locale_struct>(), - 8usize, - concat!("Alignment of ", stringify!(__locale_struct)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__locales) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__locale_struct), - "::", - stringify!(__locales) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__ctype_b) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(__locale_struct), - "::", - stringify!(__ctype_b) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__ctype_tolower) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(__locale_struct), - "::", - stringify!(__ctype_tolower) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__ctype_toupper) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(__locale_struct), - "::", - stringify!(__ctype_toupper) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__names) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(__locale_struct), - "::", - stringify!(__names) - ) - ); -} +#[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" { @@ -1550,155 +1010,58 @@ pub struct __atomic_wide_counter__bindgen_ty_1 { pub __low: ::std::os::raw::c_uint, pub __high: ::std::os::raw::c_uint, } -#[test] -fn bindgen_test_layout___atomic_wide_counter__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__atomic_wide_counter__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__atomic_wide_counter__bindgen_ty_1>(), - 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__atomic_wide_counter__bindgen_ty_1>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__atomic_wide_counter__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__low) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__high) - ) - ); -} -#[test] -fn bindgen_test_layout___atomic_wide_counter() { - const UNINIT: ::std::mem::MaybeUninit<__atomic_wide_counter> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__atomic_wide_counter>(), - 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter)) - ); - assert_eq!( - ::std::mem::align_of::<__atomic_wide_counter>(), - 8usize, - concat!("Alignment of ", stringify!(__atomic_wide_counter)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__value64) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value64) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__value32) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value32) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout___pthread_internal_list() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_internal_list> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_internal_list>(), - 16usize, - concat!("Size of: ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_internal_list>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__next) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout___pthread_internal_slist() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_internal_slist> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_internal_slist>(), - 8usize, - concat!("Size of: ", stringify!(__pthread_internal_slist)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_internal_slist>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_slist)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_slist), - "::", - stringify!(__next) - ) - ); -} +#[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)] @@ -1712,101 +1075,27 @@ pub struct __pthread_mutex_s { pub __elision: ::std::os::raw::c_short, pub __list: __pthread_list_t, } -#[test] -fn bindgen_test_layout___pthread_mutex_s() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_mutex_s> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_mutex_s>(), - 40usize, - concat!("Size of: ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_mutex_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__lock) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__owner) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__owner) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__nusers) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__nusers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__kind) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__kind) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__spins) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__spins) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__elision) as usize - ptr as usize }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__elision) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__list) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__list) - ) - ); -} +#[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 { @@ -1823,142 +1112,36 @@ pub struct __pthread_rwlock_arch_t { pub __pad2: ::std::os::raw::c_ulong, pub __flags: ::std::os::raw::c_uint, } -#[test] -fn bindgen_test_layout___pthread_rwlock_arch_t() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_rwlock_arch_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_rwlock_arch_t>(), - 56usize, - concat!("Size of: ", stringify!(__pthread_rwlock_arch_t)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_rwlock_arch_t>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__readers) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__readers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__writers) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wrphase_futex) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__wrphase_futex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__writers_futex) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers_futex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad4) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad4) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cur_writer) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__cur_writer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__shared) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__shared) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__rwelision) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__rwelision) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize }, - 33usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__flags) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__flags) - ) - ); -} +#[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 { @@ -1970,91 +1153,25 @@ pub struct __pthread_cond_s { pub __wrefs: ::std::os::raw::c_uint, pub __g_signals: [::std::os::raw::c_uint; 2usize], } -#[test] -fn bindgen_test_layout___pthread_cond_s() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s>(), - 48usize, - concat!("Size of: ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wseq) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wseq) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g1_start) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_start) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g_refs) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_refs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g_size) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g1_orig_size) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_orig_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wrefs) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wrefs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g_signals) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_signals) - ) - ); -} +#[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)] @@ -2062,31 +1179,12 @@ pub type __thrd_t = ::std::os::raw::c_ulong; pub struct __once_flag { pub __data: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___once_flag() { - const UNINIT: ::std::mem::MaybeUninit<__once_flag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__once_flag>(), - 4usize, - concat!("Size of: ", stringify!(__once_flag)) - ); - assert_eq!( - ::std::mem::align_of::<__once_flag>(), - 4usize, - concat!("Alignment of ", stringify!(__once_flag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__once_flag), - "::", - stringify!(__data) - ) - ); -} +#[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)] @@ -2094,82 +1192,30 @@ pub union pthread_mutexattr_t { pub __size: [::std::os::raw::c_char; 4usize], pub __align: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_pthread_mutexattr_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_mutexattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_mutexattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__align) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_pthread_condattr_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_condattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_condattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__align) - ) - ); -} +#[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)] @@ -2178,41 +1224,15 @@ pub union pthread_attr_t { pub __size: [::std::os::raw::c_char; 56usize], pub __align: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_pthread_attr_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__align) - ) - ); -} +#[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 { @@ -2220,51 +1240,17 @@ pub union pthread_mutex_t { pub __size: [::std::os::raw::c_char; 40usize], pub __align: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_pthread_mutex_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__align) - ) - ); -} +#[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 { @@ -2272,51 +1258,17 @@ pub union pthread_cond_t { pub __size: [::std::os::raw::c_char; 48usize], pub __align: ::std::os::raw::c_longlong, } -#[test] -fn bindgen_test_layout_pthread_cond_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__align) - ) - ); -} +#[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 { @@ -2324,92 +1276,32 @@ pub union pthread_rwlock_t { pub __size: [::std::os::raw::c_char; 56usize], pub __align: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_pthread_rwlock_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__align) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_pthread_rwlockattr_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pthread_rwlockattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__align) - ) - ); -} +#[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)] @@ -2417,83 +1309,31 @@ pub union pthread_barrier_t { pub __size: [::std::os::raw::c_char; 32usize], pub __align: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_pthread_barrier_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__align) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_pthread_barrierattr_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_barrierattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_barrierattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__align) - ) - ); -} +#[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; } @@ -2541,62 +1381,20 @@ pub struct _pthread_cleanup_buffer { pub __canceltype: ::std::os::raw::c_int, pub __prev: *mut _pthread_cleanup_buffer, } -#[test] -fn bindgen_test_layout__pthread_cleanup_buffer() { - const UNINIT: ::std::mem::MaybeUninit<_pthread_cleanup_buffer> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_pthread_cleanup_buffer>(), - 32usize, - concat!("Size of: ", stringify!(_pthread_cleanup_buffer)) - ); - assert_eq!( - ::std::mem::align_of::<_pthread_cleanup_buffer>(), - 8usize, - concat!("Alignment of ", stringify!(_pthread_cleanup_buffer)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__routine) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_pthread_cleanup_buffer), - "::", - stringify!(__routine) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__arg) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_pthread_cleanup_buffer), - "::", - stringify!(__arg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__canceltype) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_pthread_cleanup_buffer), - "::", - stringify!(__canceltype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_pthread_cleanup_buffer), - "::", - stringify!(__prev) - ) - ); -} +#[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; @@ -2892,83 +1690,31 @@ pub struct __cancel_jmp_buf_tag { pub __cancel_jmp_buf: __jmp_buf, pub __mask_was_saved: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___cancel_jmp_buf_tag() { - const UNINIT: ::std::mem::MaybeUninit<__cancel_jmp_buf_tag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__cancel_jmp_buf_tag>(), - 72usize, - concat!("Size of: ", stringify!(__cancel_jmp_buf_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__cancel_jmp_buf_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__cancel_jmp_buf_tag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cancel_jmp_buf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__cancel_jmp_buf_tag), - "::", - stringify!(__cancel_jmp_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__mask_was_saved) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(__cancel_jmp_buf_tag), - "::", - stringify!(__mask_was_saved) - ) - ); -} +#[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], } -#[test] -fn bindgen_test_layout___pthread_unwind_buf_t() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_unwind_buf_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_unwind_buf_t>(), - 104usize, - concat!("Size of: ", stringify!(__pthread_unwind_buf_t)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_unwind_buf_t>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_unwind_buf_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cancel_jmp_buf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_unwind_buf_t), - "::", - stringify!(__cancel_jmp_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__pthread_unwind_buf_t), - "::", - stringify!(__pad) - ) - ); -} +#[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 { @@ -2978,62 +1724,20 @@ pub struct __pthread_cleanup_frame { pub __do_it: ::std::os::raw::c_int, pub __cancel_type: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___pthread_cleanup_frame() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_frame> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cleanup_frame>(), - 24usize, - concat!("Size of: ", stringify!(__pthread_cleanup_frame)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cleanup_frame>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cleanup_frame)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cancel_routine) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cleanup_frame), - "::", - stringify!(__cancel_routine) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cancel_arg) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cleanup_frame), - "::", - stringify!(__cancel_arg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__do_it) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cleanup_frame), - "::", - stringify!(__do_it) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cancel_type) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cleanup_frame), - "::", - stringify!(__cancel_type) - ) - ); -} +#[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 { @@ -3043,62 +1747,20 @@ pub struct __pthread_cleanup_class { pub __do_it: ::std::os::raw::c_int, pub __cancel_type: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___pthread_cleanup_class() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_class> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cleanup_class>(), - 24usize, - concat!("Size of: ", stringify!(__pthread_cleanup_class)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cleanup_class>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cleanup_class)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cancel_routine) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cleanup_class), - "::", - stringify!(__cancel_routine) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cancel_arg) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cleanup_class), - "::", - stringify!(__cancel_arg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__do_it) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cleanup_class), - "::", - stringify!(__do_it) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cancel_type) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cleanup_class), - "::", - stringify!(__cancel_type) - ) - ); -} +#[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, @@ -3453,41 +2115,13 @@ pub struct RustDynPtr { pub data: *mut ::std::os::raw::c_void, pub vtable: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_RustDynPtr() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(RustDynPtr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(RustDynPtr)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RustDynPtr), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vtable) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(RustDynPtr), - "::", - stringify!(vtable) - ) - ); -} +#[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 { @@ -3497,71 +2131,20 @@ pub struct BumpAllocator { pub space: RustDynPtr, pub context: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_BumpAllocator() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(BumpAllocator)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(BumpAllocator)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BumpAllocator), - "::", - stringify!(tls) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cursor) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(BumpAllocator), - "::", - stringify!(cursor) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(BumpAllocator), - "::", - stringify!(limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).space) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(BumpAllocator), - "::", - stringify!(space) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(BumpAllocator), - "::", - stringify!(context) - ) - ); -} +#[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 { @@ -3569,51 +2152,17 @@ pub struct LargeObjectAllocator { pub space: *mut ::std::os::raw::c_void, pub context: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_LargeObjectAllocator() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(LargeObjectAllocator)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(LargeObjectAllocator)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(LargeObjectAllocator), - "::", - stringify!(tls) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).space) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(LargeObjectAllocator), - "::", - stringify!(space) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(LargeObjectAllocator), - "::", - stringify!(context) - ) - ); -} +#[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 { @@ -3631,181 +2180,46 @@ pub struct ImmixAllocator { pub line_opt_tag: u8, pub line_opt: usize, } -#[test] -fn bindgen_test_layout_ImmixAllocator() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - concat!("Size of: ", stringify!(ImmixAllocator)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ImmixAllocator)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(tls) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cursor) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(cursor) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).immix_space) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(immix_space) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hot) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(hot) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).copy) as usize - ptr as usize }, - 41usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(copy) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).large_cursor) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(large_cursor) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).large_limit) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(large_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).request_for_large) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(request_for_large) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._align) as usize - ptr as usize }, - 65usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(_align) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).line_opt_tag) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(line_opt_tag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).line_opt) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(ImmixAllocator), - "::", - stringify!(line_opt) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_FLBlock() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(FLBlock)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(FLBlock)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).Address) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(FLBlock), - "::", - stringify!(Address) - ) - ); -} +#[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 { @@ -3814,61 +2228,15 @@ pub struct FLBlockList { pub size: usize, pub lock: ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_FLBlockList() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(FLBlockList)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(FLBlockList)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).first) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(FLBlockList), - "::", - stringify!(first) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).last) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(FLBlockList), - "::", - stringify!(last) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(FLBlockList), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lock) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(FLBlockList), - "::", - stringify!(lock) - ) - ); -} +#[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 { @@ -3880,91 +2248,25 @@ pub struct FreeListAllocator { pub unswept_blocks: *mut FLBlockList, pub consumed_blocks: *mut FLBlockList, } -#[test] -fn bindgen_test_layout_FreeListAllocator() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(FreeListAllocator)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(FreeListAllocator)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(FreeListAllocator), - "::", - stringify!(tls) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).space) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(FreeListAllocator), - "::", - stringify!(space) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(FreeListAllocator), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).available_blocks) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(FreeListAllocator), - "::", - stringify!(available_blocks) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).available_blocks_stress) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(FreeListAllocator), - "::", - stringify!(available_blocks_stress) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).unswept_blocks) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(FreeListAllocator), - "::", - stringify!(unswept_blocks) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).consumed_blocks) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(FreeListAllocator), - "::", - stringify!(consumed_blocks) - ) - ); -} +#[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 { @@ -3972,81 +2274,29 @@ pub struct MMTkMallocAllocator { pub space: *mut ::std::os::raw::c_void, pub context: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_MMTkMallocAllocator() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(MMTkMallocAllocator)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MMTkMallocAllocator)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MMTkMallocAllocator), - "::", - stringify!(tls) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).space) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(MMTkMallocAllocator), - "::", - stringify!(space) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(MMTkMallocAllocator), - "::", - stringify!(context) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_MarkCompactAllocator() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(MarkCompactAllocator)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MarkCompactAllocator)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bump_allocator) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MarkCompactAllocator), - "::", - stringify!(bump_allocator) - ) - ); -} +#[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 { @@ -4057,81 +2307,21 @@ pub struct Allocators { pub free_list: [FreeListAllocator; 2usize], pub markcompact: [MarkCompactAllocator; 1usize], } -#[test] -fn bindgen_test_layout_Allocators() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 608usize, - concat!("Size of: ", stringify!(Allocators)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Allocators)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bump_pointer) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Allocators), - "::", - stringify!(bump_pointer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).large_object) as usize - ptr as usize }, - 288usize, - concat!( - "Offset of field: ", - stringify!(Allocators), - "::", - stringify!(large_object) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc) as usize - ptr as usize }, - 336usize, - concat!( - "Offset of field: ", - stringify!(Allocators), - "::", - stringify!(malloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).immix) as usize - ptr as usize }, - 360usize, - concat!( - "Offset of field: ", - stringify!(Allocators), - "::", - stringify!(immix) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).free_list) as usize - ptr as usize }, - 448usize, - concat!( - "Offset of field: ", - stringify!(Allocators), - "::", - stringify!(free_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).markcompact) as usize - ptr as usize }, - 560usize, - concat!( - "Offset of field: ", - stringify!(Allocators), - "::", - stringify!(markcompact) - ) - ); -} +#[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 { @@ -4140,101 +2330,43 @@ pub struct MutatorConfig { pub prepare_func: RustDynPtr, pub release_func: RustDynPtr, } -#[test] -fn bindgen_test_layout_MutatorConfig() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(MutatorConfig)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MutatorConfig)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).allocator_mapping) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MutatorConfig), - "::", - stringify!(allocator_mapping) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).space_mapping) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(MutatorConfig), - "::", - stringify!(space_mapping) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prepare_func) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(MutatorConfig), - "::", - stringify!(prepare_func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).release_func) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(MutatorConfig), - "::", - stringify!(release_func) - ) - ); -} +#[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], } -#[test] -fn bindgen_test_layout_MMTkMutatorContext() { - assert_eq!( - ::std::mem::size_of::(), - 696usize, - concat!("Size of: ", stringify!(MMTkMutatorContext)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MMTkMutatorContext)) - ); -} +#[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)] -#[repr(align(8))] #[derive(Debug, Copy, Clone)] pub struct mmtk__jl_taggedvalue_bits { - pub _bitfield_align_1: [u32; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, - pub __bindgen_padding_0: u32, -} -#[test] -fn bindgen_test_layout_mmtk__jl_taggedvalue_bits() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(mmtk__jl_taggedvalue_bits)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(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 { @@ -4271,13 +2403,13 @@ impl mmtk__jl_taggedvalue_bits { } #[inline] pub fn tag(&self) -> usize { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 28u8) as u64) } + 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, 28u8, val as u64) + self._bitfield_1.set(4usize, 60u8, val as u64) } } #[inline] @@ -4286,8 +2418,8 @@ impl mmtk__jl_taggedvalue_bits { in_image: usize, unused: usize, tag: usize, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + ) -> __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 @@ -4300,7 +2432,7 @@ impl mmtk__jl_taggedvalue_bits { let unused: u64 = unsafe { ::std::mem::transmute(unused) }; unused as u64 }); - __bindgen_bitfield_unit.set(4usize, 28u8, { + __bindgen_bitfield_unit.set(4usize, 60u8, { let tag: u64 = unsafe { ::std::mem::transmute(tag) }; tag as u64 }); @@ -4327,81 +2459,27 @@ pub union mmtk__jl_taggedvalue_t__bindgen_ty_1 { pub type_: *mut mmtk_jl_value_t, pub bits: mmtk__jl_taggedvalue_bits, } -#[test] -fn bindgen_test_layout_mmtk__jl_taggedvalue_t__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(mmtk__jl_taggedvalue_t__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(mmtk__jl_taggedvalue_t__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).header) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_taggedvalue_t__bindgen_ty_1), - "::", - stringify!(header) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_taggedvalue_t__bindgen_ty_1), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_taggedvalue_t__bindgen_ty_1), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_taggedvalue_t__bindgen_ty_1), - "::", - stringify!(bits) - ) - ); -} -#[test] -fn bindgen_test_layout_mmtk__jl_taggedvalue_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(mmtk__jl_taggedvalue_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_taggedvalue_t)) - ); -} +#[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 { @@ -4413,31 +2491,18 @@ pub struct mmtk_jl_datatype_layout_t { pub flags: mmtk_jl_datatype_layout_t__bindgen_ty_1, } #[repr(C)] -#[repr(align(2))] #[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]>, } -#[test] -fn bindgen_test_layout_mmtk_jl_datatype_layout_t__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 2usize, - concat!( - "Size of: ", - stringify!(mmtk_jl_datatype_layout_t__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!( - "Alignment of ", - stringify!(mmtk_jl_datatype_layout_t__bindgen_ty_1) - ) - ); -} +#[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 { @@ -4542,82 +2607,25 @@ impl mmtk_jl_datatype_layout_t__bindgen_ty_1 { __bindgen_bitfield_unit } } -#[test] -fn bindgen_test_layout_mmtk_jl_datatype_layout_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(mmtk_jl_datatype_layout_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(mmtk_jl_datatype_layout_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_datatype_layout_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nfields) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_datatype_layout_t), - "::", - stringify!(nfields) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).npointers) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_datatype_layout_t), - "::", - stringify!(npointers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).first_ptr) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_datatype_layout_t), - "::", - stringify!(first_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alignment) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_datatype_layout_t), - "::", - stringify!(alignment) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_datatype_layout_t), - "::", - stringify!(flags) - ) - ); -} +#[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 { @@ -4638,161 +2646,39 @@ pub struct mmtk_jl_typename_t { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub max_methods: u8, } -#[test] -fn bindgen_test_layout_mmtk_jl_typename_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 104usize, - concat!("Size of: ", stringify!(mmtk_jl_typename_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_typename_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).module) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(module) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).names) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(names) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).atomicfields) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(atomicfields) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).constfields) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(constfields) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wrapper) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(wrapper) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).Typeofwrapper) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(Typeofwrapper) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cache) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).linearcache) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(linearcache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mt) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(mt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partial) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(partial) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(hash) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_uninitialized) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(n_uninitialized) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_methods) as usize - ptr as usize }, - 101usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_typename_t), - "::", - stringify!(max_methods) - ) - ); -} +#[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 { @@ -4870,31 +2756,13 @@ impl mmtk_jl_typename_t { pub struct mmtk_jl_svec_t { pub length: usize, } -#[test] -fn bindgen_test_layout_mmtk_jl_svec_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(mmtk_jl_svec_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_svec_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_svec_t), - "::", - stringify!(length) - ) - ); -} +#[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 { @@ -4909,91 +2777,25 @@ pub struct mmtk__jl_datatype_t { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, pub __bindgen_padding_0: u16, } -#[test] -fn bindgen_test_layout_mmtk__jl_datatype_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(mmtk__jl_datatype_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_datatype_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_datatype_t), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).super_) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_datatype_t), - "::", - stringify!(super_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parameters) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_datatype_t), - "::", - stringify!(parameters) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).types) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_datatype_t), - "::", - stringify!(types) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).instance) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_datatype_t), - "::", - stringify!(instance) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).layout) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_datatype_t), - "::", - stringify!(layout) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_datatype_t), - "::", - stringify!(hash) - ) - ); -} +#[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 { @@ -5186,125 +2988,48 @@ pub struct mmtk_jl_genericmemory_t { pub length: usize, pub ptr: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_mmtk_jl_genericmemory_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(mmtk_jl_genericmemory_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_genericmemory_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_genericmemory_t), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_genericmemory_t), - "::", - stringify!(ptr) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_mmtk_jl_genericmemoryref_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(mmtk_jl_genericmemoryref_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_genericmemoryref_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptr_or_offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_genericmemoryref_t), - "::", - stringify!(ptr_or_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mem) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_genericmemoryref_t), - "::", - stringify!(mem) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_mmtk_jl_array_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(mmtk_jl_array_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_array_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_array_t), - "::", - stringify!(ref_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dimsize) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_array_t), - "::", - stringify!(dimsize) - ) - ); -} +#[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 { @@ -5312,125 +3037,74 @@ pub struct mmtk__jl_sym_t { pub right: u64, pub hash: usize, } -#[test] -fn bindgen_test_layout_mmtk__jl_sym_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(mmtk__jl_sym_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_sym_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_sym_t), - "::", - stringify!(left) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_sym_t), - "::", - stringify!(right) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_sym_t), - "::", - stringify!(hash) - ) - ); -} +#[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 value: u64, pub globalref: *mut ::std::os::raw::c_void, - pub owner: *mut mmtk__jl_binding_t, - pub ty: u64, + pub value: u64, + pub partitions: u64, pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub __bindgen_padding_0: [u8; 7usize], } -#[test] -fn bindgen_test_layout_mmtk_jl_binding_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mmtk_jl_binding_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_binding_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_binding_t), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).globalref) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_binding_t), - "::", - stringify!(globalref) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).owner) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_binding_t), - "::", - stringify!(owner) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ty) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_binding_t), - "::", - stringify!(ty) - ) - ); -} +#[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 constp(&self) -> u8 { + pub fn declared(&self) -> u8 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } } #[inline] - pub fn set_constp(&mut self, val: u8) { + 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) @@ -5459,63 +3133,39 @@ impl mmtk_jl_binding_t { } } #[inline] - pub fn imported(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) } - } - #[inline] - pub fn set_imported(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingfailed(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) } - } - #[inline] - pub fn set_usingfailed(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] pub fn deprecated(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 2u8) as 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(5usize, 2u8, val as u64) + self._bitfield_1.set(3usize, 2u8, val as u64) } } #[inline] pub fn padding(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as 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(7usize, 1u8, val as u64) + self._bitfield_1.set(5usize, 3u8, val as u64) } } #[inline] pub fn new_bitfield_1( - constp: u8, + declared: u8, exportp: u8, publicp: u8, - imported: u8, - usingfailed: 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 constp: u8 = unsafe { ::std::mem::transmute(constp) }; - constp as u64 + 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) }; @@ -5525,19 +3175,11 @@ impl mmtk_jl_binding_t { let publicp: u8 = unsafe { ::std::mem::transmute(publicp) }; publicp as u64 }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let imported: u8 = unsafe { ::std::mem::transmute(imported) }; - imported as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let usingfailed: u8 = unsafe { ::std::mem::transmute(usingfailed) }; - usingfailed as u64 - }); - __bindgen_bitfield_unit.set(5usize, 2u8, { + __bindgen_bitfield_unit.set(3usize, 2u8, { let deprecated: u8 = unsafe { ::std::mem::transmute(deprecated) }; deprecated as u64 }); - __bindgen_bitfield_unit.set(7usize, 1u8, { + __bindgen_bitfield_unit.set(5usize, 3u8, { let padding: u8 = unsafe { ::std::mem::transmute(padding) }; padding as u64 }); @@ -5551,51 +3193,16 @@ pub struct mmtk_htable_t { pub table: *mut *mut ::std::os::raw::c_void, pub _space: [*mut ::std::os::raw::c_void; 32usize], } -#[test] -fn bindgen_test_layout_mmtk_htable_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 272usize, - concat!("Size of: ", stringify!(mmtk_htable_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_htable_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_htable_t), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).table) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_htable_t), - "::", - stringify!(table) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._space) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_htable_t), - "::", - stringify!(_space) - ) - ); -} +#[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 { @@ -5604,61 +3211,19 @@ pub struct mmtk_arraylist_t { pub items: *mut *mut ::std::os::raw::c_void, pub _space: [*mut ::std::os::raw::c_void; 29usize], } -#[test] -fn bindgen_test_layout_mmtk_arraylist_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 256usize, - concat!("Size of: ", stringify!(mmtk_arraylist_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_arraylist_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_arraylist_t), - "::", - stringify!(len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_arraylist_t), - "::", - stringify!(max) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).items) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_arraylist_t), - "::", - stringify!(items) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._space) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk_arraylist_t), - "::", - stringify!(_space) - ) - ); -} +#[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 { @@ -5667,144 +3232,48 @@ pub struct mmtk_small_arraylist_t { pub items: *mut *mut ::std::os::raw::c_void, pub _space: [*mut ::std::os::raw::c_void; 6usize], } -#[test] -fn bindgen_test_layout_mmtk_small_arraylist_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(mmtk_small_arraylist_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_small_arraylist_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_small_arraylist_t), - "::", - stringify!(len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(mmtk_small_arraylist_t), - "::", - stringify!(max) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).items) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_small_arraylist_t), - "::", - stringify!(items) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._space) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_small_arraylist_t), - "::", - stringify!(_space) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_mmtk_jl_uuid_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(mmtk_jl_uuid_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_uuid_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hi) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_uuid_t), - "::", - stringify!(hi) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lo) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_uuid_t), - "::", - stringify!(lo) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_mmtk_jl_mutex_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(mmtk_jl_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_mutex_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).owner) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_mutex_t), - "::", - stringify!(owner) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_mutex_t), - "::", - stringify!(count) - ) - ); -} +#[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 { @@ -5812,6 +3281,8 @@ pub struct mmtk__jl_module_t { 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, @@ -5825,181 +3296,47 @@ pub struct mmtk__jl_module_t { pub lock: mmtk_jl_mutex_t, pub hash: isize, } -#[test] -fn bindgen_test_layout_mmtk__jl_module_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 360usize, - concat!("Size of: ", stringify!(mmtk__jl_module_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_module_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(parent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bindings) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(bindings) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bindingkeyset) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(bindingkeyset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).usings) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(usings) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).build_id) as usize - ptr as usize }, - 288usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(build_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uuid) as usize - ptr as usize }, - 304usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(uuid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).counter) as usize - ptr as usize }, - 320usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(counter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nospecialize) as usize - ptr as usize }, - 324usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(nospecialize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).optlevel) as usize - ptr as usize }, - 328usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(optlevel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).compile) as usize - ptr as usize }, - 329usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(compile) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).infer) as usize - ptr as usize }, - 330usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(infer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).istopmod) as usize - ptr as usize }, - 331usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(istopmod) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_methods) as usize - ptr as usize }, - 332usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(max_methods) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lock) as usize - ptr as usize }, - 336usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, - 352usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_module_t), - "::", - stringify!(hash) - ) - ); -} +#[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)] @@ -6007,41 +3344,15 @@ pub struct mmtk__jl_excstack_t { pub top: usize, pub reserved_size: usize, } -#[test] -fn bindgen_test_layout_mmtk__jl_excstack_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(mmtk__jl_excstack_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_excstack_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).top) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_excstack_t), - "::", - stringify!(top) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_excstack_t), - "::", - stringify!(reserved_size) - ) - ); -} +#[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 { @@ -6053,58 +3364,23 @@ pub union mmtk__jl_bt_element_t__bindgen_ty_1 { pub uintptr: usize, pub jlvalue: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_mmtk__jl_bt_element_t__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(mmtk__jl_bt_element_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(mmtk__jl_bt_element_t__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uintptr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_bt_element_t__bindgen_ty_1), - "::", - stringify!(uintptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jlvalue) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_bt_element_t__bindgen_ty_1), - "::", - stringify!(jlvalue) - ) - ); -} -#[test] -fn bindgen_test_layout_mmtk__jl_bt_element_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(mmtk__jl_bt_element_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_bt_element_t)) - ); -} +#[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)] @@ -6112,95 +3388,91 @@ pub type mmtk_jl_excstack_t = mmtk__jl_excstack_t; pub struct mmtk_jl_stack_context_t { pub uc_mcontext: sigjmp_buf, } -#[test] -fn bindgen_test_layout_mmtk_jl_stack_context_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 200usize, - concat!("Size of: ", stringify!(mmtk_jl_stack_context_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_stack_context_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_mcontext) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_stack_context_t), - "::", - stringify!(uc_mcontext) - ) - ); -} +#[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: mmtk__jl_ucontext_t, - pub copy_ctx: mmtk_jl_stack_context_t, -} -#[test] -fn bindgen_test_layout_mmtk_jl_ucontext_t__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 200usize, - concat!("Size of: ", stringify!(mmtk_jl_ucontext_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(mmtk_jl_ucontext_t__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_ucontext_t__bindgen_ty_1), - "::", - stringify!(ctx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).copy_ctx) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_ucontext_t__bindgen_ty_1), - "::", - stringify!(copy_ctx) - ) - ); -} -#[test] -fn bindgen_test_layout_mmtk_jl_ucontext_t() { - assert_eq!( - ::std::mem::size_of::(), - 200usize, - concat!("Size of: ", stringify!(mmtk_jl_ucontext_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_ucontext_t)) - ); + 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)] @@ -6209,41 +3481,15 @@ pub struct mmtk__jl_gcframe_t { pub nroots: usize, pub prev: *mut mmtk__jl_gcframe_t, } -#[test] -fn bindgen_test_layout_mmtk__jl_gcframe_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(mmtk__jl_gcframe_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_gcframe_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nroots) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_gcframe_t), - "::", - stringify!(nroots) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_gcframe_t), - "::", - stringify!(prev) - ) - ); -} +#[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 { @@ -6251,54 +3497,20 @@ pub struct mmtk_jl_gc_pool_t { pub newpages: *mut mmtk_jl_taggedvalue_t, pub osize: u16, } -#[test] -fn bindgen_test_layout_mmtk_jl_gc_pool_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(mmtk_jl_gc_pool_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_gc_pool_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).freelist) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_pool_t), - "::", - stringify!(freelist) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).newpages) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_pool_t), - "::", - stringify!(newpages) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).osize) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_pool_t), - "::", - stringify!(osize) - ) - ); -} +#[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_t { +pub struct mmtk_jl_thread_gc_num_common_t { pub allocd: u64, pub pool_live_bytes: u64, pub malloc: u64, @@ -6308,221 +3520,55 @@ pub struct mmtk_jl_thread_gc_num_t { pub free_acc: u64, pub alloc_acc: u64, } -#[test] -fn bindgen_test_layout_mmtk_jl_thread_gc_num_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(mmtk_jl_thread_gc_num_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_thread_gc_num_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).allocd) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_gc_num_t), - "::", - stringify!(allocd) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pool_live_bytes) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_gc_num_t), - "::", - stringify!(pool_live_bytes) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_gc_num_t), - "::", - stringify!(malloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).realloc) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_gc_num_t), - "::", - stringify!(realloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).poolalloc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_gc_num_t), - "::", - stringify!(poolalloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bigalloc) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_gc_num_t), - "::", - stringify!(bigalloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).free_acc) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_gc_num_t), - "::", - stringify!(free_acc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alloc_acc) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_gc_num_t), - "::", - stringify!(alloc_acc) - ) - ); -} +#[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_t { +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 _mallocarray_t, - pub mafreelist: *mut _mallocarray_t, - pub big_objects: *mut _bigval_t, - pub remset_nptr: ::std::os::raw::c_int, - pub remset: mmtk_arraylist_t, - pub norm_pools: [mmtk_jl_gc_pool_t; 51usize], + pub mallocarrays: *mut _mallocmemory_t, + pub mafreelist: *mut _mallocmemory_t, pub free_stacks: [mmtk_small_arraylist_t; 16usize], } -#[test] -fn bindgen_test_layout_mmtk_jl_thread_heap_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 2664usize, - concat!("Size of: ", stringify!(mmtk_jl_thread_heap_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_thread_heap_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).weak_refs) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_heap_t), - "::", - stringify!(weak_refs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).live_tasks) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_heap_t), - "::", - stringify!(live_tasks) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mallocarrays) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_heap_t), - "::", - stringify!(mallocarrays) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mafreelist) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_heap_t), - "::", - stringify!(mafreelist) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).big_objects) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_heap_t), - "::", - stringify!(big_objects) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).remset_nptr) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_heap_t), - "::", - stringify!(remset_nptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).remset) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_heap_t), - "::", - stringify!(remset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).norm_pools) as usize - ptr as usize }, - 416usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_heap_t), - "::", - stringify!(norm_pools) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).free_stacks) as usize - ptr as usize }, - 1640usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_thread_heap_t), - "::", - stringify!(free_stacks) - ) - ); -} +#[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))] @@ -6534,51 +3580,17 @@ pub struct mmtk_ws_queue_t { pub __bindgen_padding_1: [u64; 7usize], pub array: u64, } -#[test] -fn bindgen_test_layout_mmtk_ws_queue_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 192usize, - concat!("Size of: ", stringify!(mmtk_ws_queue_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 64usize, - concat!("Alignment of ", stringify!(mmtk_ws_queue_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).top) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_ws_queue_t), - "::", - stringify!(top) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bottom) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mmtk_ws_queue_t), - "::", - stringify!(bottom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).array) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(mmtk_ws_queue_t), - "::", - stringify!(array) - ) - ); -} +#[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)] @@ -6587,83 +3599,31 @@ pub struct mmtk_jl_gc_markqueue_t { pub ptr_queue: mmtk_ws_queue_t, pub reclaim_set: mmtk_arraylist_t, } -#[test] -fn bindgen_test_layout_mmtk_jl_gc_markqueue_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 640usize, - concat!("Size of: ", stringify!(mmtk_jl_gc_markqueue_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 64usize, - concat!("Alignment of ", stringify!(mmtk_jl_gc_markqueue_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).chunk_queue) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_markqueue_t), - "::", - stringify!(chunk_queue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptr_queue) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_markqueue_t), - "::", - stringify!(ptr_queue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reclaim_set) as usize - ptr as usize }, - 384usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_markqueue_t), - "::", - stringify!(reclaim_set) - ) - ); -} +#[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, } -#[test] -fn bindgen_test_layout_mmtk_jl_gc_page_stack_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(mmtk_jl_gc_page_stack_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_gc_page_stack_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bottom) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_page_stack_t), - "::", - stringify!(bottom) - ) - ); -} +#[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 { @@ -6672,163 +3632,55 @@ pub struct mmtk_jl_gc_mark_cache_t { pub nbig_obj: usize, pub big_obj: [*mut ::std::os::raw::c_void; 1024usize], } -#[test] -fn bindgen_test_layout_mmtk_jl_gc_mark_cache_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8216usize, - concat!("Size of: ", stringify!(mmtk_jl_gc_mark_cache_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_gc_mark_cache_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).perm_scanned_bytes) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_mark_cache_t), - "::", - stringify!(perm_scanned_bytes) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scanned_bytes) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_mark_cache_t), - "::", - stringify!(scanned_bytes) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nbig_obj) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_mark_cache_t), - "::", - stringify!(nbig_obj) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).big_obj) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_mark_cache_t), - "::", - stringify!(big_obj) - ) - ); -} +#[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)] -#[repr(align(64))] -#[derive(Debug, Copy, Clone)] pub struct mmtk_jl_gc_tls_states_t { - pub heap: mmtk_jl_thread_heap_t, - pub page_metadata_allocd: mmtk_jl_gc_page_stack_t, - pub gc_num: mmtk_jl_thread_gc_num_t, - pub __bindgen_padding_0: [u64; 2usize], - pub mark_queue: mmtk_jl_gc_markqueue_t, - pub gc_cache: mmtk_jl_gc_mark_cache_t, - pub gc_sweeps_requested: u64, - pub sweep_objs: mmtk_arraylist_t, -} -#[test] -fn bindgen_test_layout_mmtk_jl_gc_tls_states_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 11904usize, - concat!("Size of: ", stringify!(mmtk_jl_gc_tls_states_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 64usize, - concat!("Alignment of ", stringify!(mmtk_jl_gc_tls_states_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).heap) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(heap) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).page_metadata_allocd) as usize - ptr as usize }, - 2664usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(page_metadata_allocd) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gc_num) as usize - ptr as usize }, - 2672usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(gc_num) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mark_queue) as usize - ptr as usize }, - 2752usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(mark_queue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gc_cache) as usize - ptr as usize }, - 3392usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(gc_cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gc_sweeps_requested) as usize - ptr as usize }, - 11608usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(gc_sweeps_requested) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sweep_objs) as usize - ptr as usize }, - 11616usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(sweep_objs) - ) - ); + 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)] -#[repr(align(64))] pub struct mmtk__jl_tls_states_t { pub tid: i16, pub threadpoolid: i8, @@ -6840,8 +3692,8 @@ pub struct mmtk__jl_tls_states_t { pub in_finalizer: i16, pub disable_gc: i16, pub finalizers_inhibited: ::std::os::raw::c_int, - pub __bindgen_padding_0: [u64; 3usize], 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, @@ -6850,7 +3702,6 @@ pub struct mmtk__jl_tls_states_t { pub timing_stack: *mut ::std::os::raw::c_void, pub stackbase: *mut ::std::os::raw::c_void, pub stacksize: usize, - pub __bindgen_anon_1: mmtk__jl_tls_states_t__bindgen_ty_1, pub sig_exception: *mut mmtk_jl_value_t, pub bt_data: *mut mmtk__jl_bt_element_t, pub bt_size: usize, @@ -6865,420 +3716,81 @@ pub struct mmtk__jl_tls_states_t { pub previous_exception: *mut _jl_value_t, pub locks: mmtk_small_arraylist_t, pub engine_nqueued: usize, - pub mmtk_mutator: MMTkMutatorContext, - pub malloc_sz_since_last_poll: usize, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union mmtk__jl_tls_states_t__bindgen_ty_1 { - pub base_ctx: mmtk__jl_ucontext_t, - pub copy_stack_ctx: mmtk_jl_stack_context_t, -} -#[test] -fn bindgen_test_layout_mmtk__jl_tls_states_t__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 200usize, - concat!("Size of: ", stringify!(mmtk__jl_tls_states_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(mmtk__jl_tls_states_t__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).base_ctx) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t__bindgen_ty_1), - "::", - stringify!(base_ctx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).copy_stack_ctx) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t__bindgen_ty_1), - "::", - stringify!(copy_stack_ctx) - ) - ); -} -#[test] -fn bindgen_test_layout_mmtk__jl_tls_states_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 13376usize, - concat!("Size of: ", stringify!(mmtk__jl_tls_states_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 64usize, - concat!("Alignment of ", stringify!(mmtk__jl_tls_states_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tid) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(tid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).threadpoolid) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(threadpoolid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rngseed) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(rngseed) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).safepoint) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(safepoint) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sleep_check_state) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(sleep_check_state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gc_state) as usize - ptr as usize }, - 25usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(gc_state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).in_pure_callback) as usize - ptr as usize }, - 26usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(in_pure_callback) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).in_finalizer) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(in_finalizer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).disable_gc) as usize - ptr as usize }, - 30usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(disable_gc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).finalizers_inhibited) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(finalizers_inhibited) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gc_tls) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(gc_tls) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).defer_signal) as usize - ptr as usize }, - 11968usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(defer_signal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).current_task) as usize - ptr as usize }, - 11976usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(current_task) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next_task) as usize - ptr as usize }, - 11984usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(next_task) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).previous_task) as usize - ptr as usize }, - 11992usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(previous_task) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).root_task) as usize - ptr as usize }, - 12000usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(root_task) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).timing_stack) as usize - ptr as usize }, - 12008usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(timing_stack) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stackbase) as usize - ptr as usize }, - 12016usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(stackbase) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stacksize) as usize - ptr as usize }, - 12024usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(stacksize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sig_exception) as usize - ptr as usize }, - 12232usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(sig_exception) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bt_data) as usize - ptr as usize }, - 12240usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(bt_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bt_size) as usize - ptr as usize }, - 12248usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(bt_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).profiling_bt_buffer) as usize - ptr as usize }, - 12256usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(profiling_bt_buffer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).signal_request) as usize - ptr as usize }, - 12264usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(signal_request) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).io_wait) as usize - ptr as usize }, - 12268usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(io_wait) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).signal_stack) as usize - ptr as usize }, - 12272usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(signal_stack) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).signal_stack_size) as usize - ptr as usize }, - 12280usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(signal_stack_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).system_id) as usize - ptr as usize }, - 12288usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(system_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).suspend_count) as usize - ptr as usize }, - 12296usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(suspend_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).finalizers) as usize - ptr as usize }, - 12304usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(finalizers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).previous_exception) as usize - ptr as usize }, - 12560usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(previous_exception) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).locks) as usize - ptr as usize }, - 12568usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(locks) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).engine_nqueued) as usize - ptr as usize }, - 12632usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(engine_nqueued) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mmtk_mutator) as usize - ptr as usize }, - 12640usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(mmtk_mutator) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_sz_since_last_poll) as usize - ptr as usize }, - 13336usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(malloc_sz_since_last_poll) - ) - ); } +#[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)] @@ -7304,328 +3816,67 @@ pub struct mmtk__jl_task_t { pub excstack: *mut mmtk_jl_excstack_t, pub eh: *mut ::std::os::raw::c_void, pub ctx: mmtk_jl_ucontext_t, - 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, -} -#[test] -fn bindgen_test_layout_mmtk__jl_task_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 376usize, - concat!("Size of: ", stringify!(mmtk__jl_task_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_task_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).queue) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(queue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(tls) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).donenotify) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(donenotify) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).result) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(result) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scope) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(scope) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(start) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rngState) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(rngState) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._state) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(_state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sticky) as usize - ptr as usize }, - 97usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(sticky) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._isexception) as usize - ptr as usize }, - 98usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(_isexception) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).priority) as usize - ptr as usize }, - 100usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(priority) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tid) as usize - ptr as usize }, - 102usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(tid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).threadpoolid) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(threadpoolid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reentrant_timing) as usize - ptr as usize }, - 105usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(reentrant_timing) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gcstack) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(gcstack) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).world_age) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(world_age) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptls) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(ptls) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).excstack) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(excstack) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eh) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(eh) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(ctx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stkbuf) as usize - ptr as usize }, - 352usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(stkbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bufsz) as usize - ptr as usize }, - 360usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_task_t), - "::", - stringify!(bufsz) - ) - ); -} -impl mmtk__jl_task_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 - } } +#[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, } -#[test] -fn bindgen_test_layout_mmtk_jl_weakref_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(mmtk_jl_weakref_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_weakref_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_weakref_t), - "::", - stringify!(value) - ) - ); -} +#[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 { @@ -7639,25 +3890,13 @@ pub struct mmtk___jl_purity_overrides_t__bindgen_ty_1 { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, } -#[test] -fn bindgen_test_layout_mmtk___jl_purity_overrides_t__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 2usize, - concat!( - "Size of: ", - stringify!(mmtk___jl_purity_overrides_t__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!( - "Alignment of ", - stringify!(mmtk___jl_purity_overrides_t__bindgen_ty_1) - ) - ); -} +#[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 { @@ -7831,42 +4070,17 @@ impl mmtk___jl_purity_overrides_t__bindgen_ty_1 { __bindgen_bitfield_unit } } -#[test] -fn bindgen_test_layout_mmtk___jl_purity_overrides_t() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 2usize, - concat!("Size of: ", stringify!(mmtk___jl_purity_overrides_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(mmtk___jl_purity_overrides_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).overrides) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk___jl_purity_overrides_t), - "::", - stringify!(overrides) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk___jl_purity_overrides_t), - "::", - stringify!(bits) - ) - ); -} +#[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)] @@ -7904,341 +4118,75 @@ pub struct mmtk__jl_method_t { pub purity: mmtk__jl_purity_overrides_t, pub writelock: mmtk_jl_mutex_t, } -#[test] -fn bindgen_test_layout_mmtk__jl_method_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 208usize, - concat!("Size of: ", stringify!(mmtk__jl_method_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_method_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).module) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(module) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).file) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(file) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).line) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(line) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).primary_world) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(primary_world) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deleted_world) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(deleted_world) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sig) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).specializations) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(specializations) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).speckeyset) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(speckeyset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).slot_syms) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(slot_syms) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).external_mt) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(external_mt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(source) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).debuginfo) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(debuginfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).unspecialized) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(unspecialized) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).generator) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(generator) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).roots) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(roots) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).root_blocks) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(root_blocks) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nroots_sysimg) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(nroots_sysimg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ccallable) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(ccallable) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).invokes) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(invokes) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).recursion_relation) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(recursion_relation) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nargs) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(nargs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).called) as usize - ptr as usize }, - 172usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(called) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nospecialize) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(nospecialize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nkw) as usize - ptr as usize }, - 180usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(nkw) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isva) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(isva) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).is_for_opaque_closure) as usize - ptr as usize }, - 185usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(is_for_opaque_closure) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nospecializeinfer) as usize - ptr as usize }, - 186usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(nospecializeinfer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).constprop) as usize - ptr as usize }, - 187usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(constprop) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_varargs) as usize - ptr as usize }, - 188usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(max_varargs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).purity) as usize - ptr as usize }, - 190usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(purity) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).writelock) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_method_t), - "::", - stringify!(writelock) - ) - ); -} +#[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; @@ -8273,17 +4221,7 @@ pub struct __locale_data { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_binding_t { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _mallocarray_t { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _bigval_t { +pub struct _mallocmemory_t { pub _address: u8, } #[repr(C)] diff --git a/mmtk/src/lib.rs b/mmtk/src/lib.rs index bc3a19f6..c15b49df 100644 --- a/mmtk/src/lib.rs +++ b/mmtk/src/lib.rs @@ -100,6 +100,7 @@ pub struct Julia_Upcalls { 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(), diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index 60fb65bb..f55d04aa 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -1,6 +1,6 @@ use crate::api::mmtk_get_obj_size; use crate::julia_scanning::{ - ijl_small_typeof, jl_genericmemory_typename, mmtk_jl_genericmemory_how, mmtk_jl_typeof, + jl_genericmemory_typename, jl_small_typeof, mmtk_jl_genericmemory_how, mmtk_jl_typeof, mmtk_jl_typetagof, }; use crate::{julia_types::*, UPCALLS}; @@ -194,7 +194,7 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { { // these objects have pointers in them, but no other special handling // so we want these to fall through to the end - vtag_usize = ijl_small_typeof[vtag.as_usize() / std::mem::size_of::
()] as usize; + 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) { @@ -242,7 +242,7 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { // NB: Strings are aligned to 8 and not to 16 return llt_align(dtsz + JULIA_HEADER_SIZE, 8); } else { - let vt = ijl_small_typeof[vtag_usize / std::mem::size_of::
()]; + let vt = jl_small_typeof[vtag_usize / std::mem::size_of::
()]; let layout = (*vt).layout; let dtsz = (*layout).size as usize; debug_assert!( diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index 3c47646d..da721240 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -36,8 +36,10 @@ impl Scanning for VMScanning { self.buffer.push(object); } } - JuliaVMSlot::Offset(_) => { - unimplemented!() // transitively pinned roots in Julia only come from the stack + JuliaVMSlot::Offset(oe) => { + if let Some(object) = oe.load() { + self.buffer.push(object); + } } } } @@ -79,8 +81,8 @@ impl Scanning for VMScanning { // need to iterate over live tasks as well to process their shadow stacks // we should not set the task themselves as roots as we will know which ones are still alive after GC let mut i = 0; - while i < ptls.gc_tls.heap.live_tasks.len { - let mut task_address = Address::from_ptr(ptls.gc_tls.heap.live_tasks.items); + 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>() }; root_scan_task(task, false); diff --git a/mmtk/src/util.rs b/mmtk/src/util.rs index 62856e13..8ea72b2d 100644 --- a/mmtk/src/util.rs +++ b/mmtk/src/util.rs @@ -73,12 +73,12 @@ pub(crate) fn get_abi_structs_checksum_rust() -> usize { ^ 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_t) - ^ print_sizeof!(mmtk_jl_thread_gc_num_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_task_t, mmtk_jl_datatype_layout_t}; +use crate::julia_types::{__BindgenBitfieldUnit, mmtk_jl_datatype_layout_t, mmtk_jl_ucontext_t}; impl mmtk_jl_datatype_layout_t { #[inline] @@ -92,7 +92,7 @@ impl mmtk_jl_datatype_layout_t { } } -impl mmtk__jl_task_t { +impl mmtk_jl_ucontext_t { #[inline] pub fn copy_stack_custom(&self) -> u32 { let copy_stack_raw: u32 = unsafe {