From ea2725890ec85c4f0da35d65ac3959616da537bb Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Mon, 2 Sep 2024 06:10:45 +0000 Subject: [PATCH 01/32] Changes to make the binding compatible with the latest version of Julia, which has MMTk as an external GC --- julia/mmtk_julia.c | 91 ++---- julia/mmtk_julia.h | 2 +- julia/mmtk_julia_types.h | 113 ++++---- mmtk/src/julia_scanning.rs | 34 ++- mmtk/src/julia_types.rs | 567 ++++++++++++++----------------------- mmtk/src/scanning.rs | 6 +- mmtk/src/util.rs | 4 +- 7 files changed, 341 insertions(+), 476 deletions(-) diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index 3244d5d7..5a4ec17e 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,7 @@ 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 void* new_mutator_iterator(void); @@ -46,62 +45,18 @@ 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) +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 +64,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.heap.mallocarrays; + mallocmemory_t **pma = &ptls2->gc_tls.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 +76,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; } @@ -456,16 +411,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_ 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..79c2244a 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 @@ -278,17 +317,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 +326,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 @@ -342,19 +374,8 @@ 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]; @@ -401,12 +422,9 @@ typedef struct { 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_tls_states_t { @@ -448,11 +466,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 +498,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 +540,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 +675,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/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index 3d53270c..8f48dcba 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -27,6 +27,7 @@ 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 jl_binding_partition_type: *const mmtk_jl_datatype_t; pub static mut ijl_small_typeof: [*mut mmtk_jl_datatype_t; 128usize]; } @@ -308,6 +309,13 @@ 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)); + 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 +387,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 +406,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() { @@ -559,6 +567,22 @@ pub fn process_slot>(closure: &mut EV, slot: Addres // mark_metadata_scanned(obj); // } +#[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; + } + + #[cfg(not(target_pointer_width = "64"))] + { + return 0; + } +} + #[inline(always)] pub fn process_offset_slot>( closure: &mut EV, diff --git a/mmtk/src/julia_types.rs b/mmtk/src/julia_types.rs index 3f8cdf69..4dec06e8 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.69.4 */ #[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; @@ -4215,12 +4215,10 @@ fn bindgen_test_layout_MMTkMutatorContext() { } 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, + pub _bitfield_align_1: [u64; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] fn bindgen_test_layout_mmtk__jl_taggedvalue_bits() { @@ -4271,13 +4269,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 +4284,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 +4298,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 }); @@ -4413,7 +4411,6 @@ 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], @@ -5358,13 +5355,89 @@ fn bindgen_test_layout_mmtk__jl_sym_t() { ); } 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, +} +#[test] +fn bindgen_test_layout_mmtk__jl_binding_partition_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_partition_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(mmtk__jl_binding_partition_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).restriction) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(mmtk__jl_binding_partition_t), + "::", + stringify!(restriction) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).min_world) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(mmtk__jl_binding_partition_t), + "::", + stringify!(min_world) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_world) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(mmtk__jl_binding_partition_t), + "::", + stringify!(max_world) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(mmtk__jl_binding_partition_t), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(mmtk__jl_binding_partition_t), + "::", + stringify!(reserved) + ) + ); +} +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], @@ -5375,7 +5448,7 @@ fn bindgen_test_layout_mmtk_jl_binding_t() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 40usize, + 32usize, concat!("Size of: ", stringify!(mmtk_jl_binding_t)) ); assert_eq!( @@ -5384,53 +5457,43 @@ fn bindgen_test_layout_mmtk_jl_binding_t() { concat!("Alignment of ", stringify!(mmtk_jl_binding_t)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).globalref) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(mmtk_jl_binding_t), "::", - stringify!(value) + stringify!(globalref) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).globalref) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(mmtk_jl_binding_t), "::", - stringify!(globalref) + stringify!(value) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).owner) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).partitions) 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) + stringify!(partitions) ) ); } 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 +5522,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 +5564,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 }); @@ -6143,12 +6174,17 @@ pub type mmtk__jl_ucontext_t = mmtk_jl_stack_context_t; #[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, + pub ctx: *mut mmtk__jl_ucontext_t, + pub copy_ctx: *mut mmtk_jl_stack_context_t, } #[test] fn bindgen_test_layout_mmtk_jl_ucontext_t__bindgen_ty_1() { @@ -6157,7 +6193,7 @@ fn bindgen_test_layout_mmtk_jl_ucontext_t__bindgen_ty_1() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 200usize, + 8usize, concat!("Size of: ", stringify!(mmtk_jl_ucontext_t__bindgen_ty_1)) ); assert_eq!( @@ -6191,9 +6227,11 @@ fn bindgen_test_layout_mmtk_jl_ucontext_t__bindgen_ty_1() { } #[test] fn bindgen_test_layout_mmtk_jl_ucontext_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 200usize, + 32usize, concat!("Size of: ", stringify!(mmtk_jl_ucontext_t)) ); assert_eq!( @@ -6201,6 +6239,66 @@ fn bindgen_test_layout_mmtk_jl_ucontext_t() { 8usize, concat!("Alignment of ", stringify!(mmtk_jl_ucontext_t)) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).stkbuf) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(mmtk_jl_ucontext_t), + "::", + stringify!(stkbuf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bufsz) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(mmtk_jl_ucontext_t), + "::", + stringify!(bufsz) + ) + ); +} +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)] @@ -6409,12 +6507,8 @@ fn bindgen_test_layout_mmtk_jl_thread_gc_num_t() { pub struct mmtk_jl_thread_heap_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] @@ -6424,7 +6518,7 @@ fn bindgen_test_layout_mmtk_jl_thread_heap_t() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 2664usize, + 1168usize, concat!("Size of: ", stringify!(mmtk_jl_thread_heap_t)) ); assert_eq!( @@ -6472,49 +6566,9 @@ fn bindgen_test_layout_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, + 144usize, concat!( "Offset of field: ", stringify!(mmtk_jl_thread_heap_t), @@ -6729,17 +6783,11 @@ fn bindgen_test_layout_mmtk_jl_gc_mark_cache_t() { ); } #[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, + pub mmtk_mutator: MMTkMutatorContext, + pub malloc_sz_since_last_poll: usize, } #[test] fn bindgen_test_layout_mmtk_jl_gc_tls_states_t() { @@ -6748,12 +6796,12 @@ fn bindgen_test_layout_mmtk_jl_gc_tls_states_t() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 11904usize, + 1936usize, concat!("Size of: ", stringify!(mmtk_jl_gc_tls_states_t)) ); assert_eq!( ::std::mem::align_of::(), - 64usize, + 8usize, concat!("Alignment of ", stringify!(mmtk_jl_gc_tls_states_t)) ); assert_eq!( @@ -6766,19 +6814,9 @@ fn bindgen_test_layout_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, + 1168usize, concat!( "Offset of field: ", stringify!(mmtk_jl_gc_tls_states_t), @@ -6787,48 +6825,27 @@ fn bindgen_test_layout_mmtk_jl_gc_tls_states_t() { ) ); 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, + unsafe { ::std::ptr::addr_of!((*ptr).mmtk_mutator) as usize - ptr as usize }, + 1232usize, concat!( "Offset of field: ", stringify!(mmtk_jl_gc_tls_states_t), "::", - stringify!(gc_sweeps_requested) + stringify!(mmtk_mutator) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sweep_objs) as usize - ptr as usize }, - 11616usize, + unsafe { ::std::ptr::addr_of!((*ptr).malloc_sz_since_last_poll) as usize - ptr as usize }, + 1928usize, concat!( "Offset of field: ", stringify!(mmtk_jl_gc_tls_states_t), "::", - stringify!(sweep_objs) + stringify!(malloc_sz_since_last_poll) ) ); } #[repr(C)] -#[repr(align(64))] pub struct mmtk__jl_tls_states_t { pub tid: i16, pub threadpoolid: i8, @@ -6840,7 +6857,6 @@ 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 defer_signal: sig_atomic_t, pub current_task: u64, @@ -6850,7 +6866,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,53 +6880,6 @@ 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() { @@ -6920,12 +6888,12 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 13376usize, + 2448usize, concat!("Size of: ", stringify!(mmtk__jl_tls_states_t)) ); assert_eq!( ::std::mem::align_of::(), - 64usize, + 8usize, concat!("Alignment of ", stringify!(mmtk__jl_tls_states_t)) ); assert_eq!( @@ -7030,7 +6998,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gc_tls) as usize - ptr as usize }, - 64usize, + 40usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7040,7 +7008,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).defer_signal) as usize - ptr as usize }, - 11968usize, + 1976usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7050,7 +7018,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).current_task) as usize - ptr as usize }, - 11976usize, + 1984usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7060,7 +7028,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).next_task) as usize - ptr as usize }, - 11984usize, + 1992usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7070,7 +7038,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).previous_task) as usize - ptr as usize }, - 11992usize, + 2000usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7080,7 +7048,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).root_task) as usize - ptr as usize }, - 12000usize, + 2008usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7090,7 +7058,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).timing_stack) as usize - ptr as usize }, - 12008usize, + 2016usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7100,7 +7068,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).stackbase) as usize - ptr as usize }, - 12016usize, + 2024usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7110,7 +7078,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).stacksize) as usize - ptr as usize }, - 12024usize, + 2032usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7120,7 +7088,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sig_exception) as usize - ptr as usize }, - 12232usize, + 2040usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7130,7 +7098,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).bt_data) as usize - ptr as usize }, - 12240usize, + 2048usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7140,7 +7108,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).bt_size) as usize - ptr as usize }, - 12248usize, + 2056usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7150,7 +7118,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).profiling_bt_buffer) as usize - ptr as usize }, - 12256usize, + 2064usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7160,7 +7128,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signal_request) as usize - ptr as usize }, - 12264usize, + 2072usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7170,7 +7138,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).io_wait) as usize - ptr as usize }, - 12268usize, + 2076usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7180,7 +7148,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signal_stack) as usize - ptr as usize }, - 12272usize, + 2080usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7190,7 +7158,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signal_stack_size) as usize - ptr as usize }, - 12280usize, + 2088usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7200,7 +7168,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).system_id) as usize - ptr as usize }, - 12288usize, + 2096usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7210,7 +7178,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).suspend_count) as usize - ptr as usize }, - 12296usize, + 2104usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7220,7 +7188,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).finalizers) as usize - ptr as usize }, - 12304usize, + 2112usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7230,7 +7198,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).previous_exception) as usize - ptr as usize }, - 12560usize, + 2368usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7240,7 +7208,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).locks) as usize - ptr as usize }, - 12568usize, + 2376usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7250,7 +7218,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).engine_nqueued) as usize - ptr as usize }, - 12632usize, + 2440usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t), @@ -7258,26 +7226,6 @@ fn bindgen_test_layout_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) - ) - ); } pub type mmtk_jl_tls_states_t = mmtk__jl_tls_states_t; #[repr(C)] @@ -7304,11 +7252,6 @@ 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() { @@ -7316,7 +7259,7 @@ fn bindgen_test_layout_mmtk__jl_task_t() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 376usize, + 184usize, concat!("Size of: ", stringify!(mmtk__jl_task_t)) ); assert_eq!( @@ -7534,66 +7477,6 @@ fn bindgen_test_layout_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 - } } pub type mmtk_jl_task_t = mmtk__jl_task_t; #[repr(C)] @@ -8273,17 +8156,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/scanning.rs b/mmtk/src/scanning.rs index 3c47646d..859355b7 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); + } } } } diff --git a/mmtk/src/util.rs b/mmtk/src/util.rs index 62856e13..b821585f 100644 --- a/mmtk/src/util.rs +++ b/mmtk/src/util.rs @@ -78,7 +78,7 @@ pub(crate) fn get_abi_structs_checksum_rust() -> usize { } // 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_ucontext_t, mmtk_jl_datatype_layout_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 { From f19ffd68489e053f5a8898aa52b59561337c8ef1 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Mon, 2 Sep 2024 06:17:58 +0000 Subject: [PATCH 02/32] Update julia_repo and julia_version --- mmtk/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 0f73770f..f295d79a 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -9,8 +9,8 @@ edition = "2018" # Metadata for the Julia repository [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_repo = "https://github.com/udesou/julia.git" +julia_version = "c7577c9180648590af0c3503942436ef282a375d" [lib] crate-type = ["cdylib"] From 63e6b50cb4bf41354717cc5343beeb3afd9fdc89 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Mon, 2 Sep 2024 06:36:44 +0000 Subject: [PATCH 03/32] Add check so that we don't try to scan a null object --- mmtk/src/julia_scanning.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index 8f48dcba..97073ada 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -314,7 +314,9 @@ pub unsafe fn scan_julia_object>(obj: Address, clos let restriction = (*bpart_ptr).restriction; let offset = mmtk_decode_restriction_value(restriction); let slot = Address::from_ptr(::std::ptr::addr_of!((*bpart_ptr).restriction)); - process_offset_slot(closure, slot, offset); + if restriction as usize - offset != 0 { + process_offset_slot(closure, slot, offset); + } } debug_assert!( (*layout).nfields > 0 && (*layout).fielddesc_type_custom() != 3, From 641d748ff2d04f182a2e4d316caa5f3af9c55dc8 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Tue, 3 Sep 2024 02:32:00 +0000 Subject: [PATCH 04/32] Skip test about heap snapshot --- .github/scripts/ci-test-patching.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/ci-test-patching.sh b/.github/scripts/ci-test-patching.sh index 843aeb93..6542c799 100755 --- a/.github/scripts/ci-test-patching.sh +++ b/.github/scripts/ci-test-patching.sh @@ -42,7 +42,9 @@ declare -a tests_to_skip=( '@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" From aeb224b00b596fa4263548b68dbffd606badd7bf Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Mon, 23 Sep 2024 05:26:30 +0000 Subject: [PATCH 05/32] Updating julia_version --- mmtk/Cargo.toml | 2 +- mmtk/src/util.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index f295d79a..3eaeb540 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/udesou/julia.git" -julia_version = "c7577c9180648590af0c3503942436ef282a375d" +julia_version = "74edc2ba7fca698381c6dd154d154d464ba256d2" [lib] crate-type = ["cdylib"] diff --git a/mmtk/src/util.rs b/mmtk/src/util.rs index b821585f..df1e4780 100644 --- a/mmtk/src/util.rs +++ b/mmtk/src/util.rs @@ -78,7 +78,7 @@ pub(crate) fn get_abi_structs_checksum_rust() -> usize { } // The functions below allow accessing the values of bitfields without performing a for loop -use crate::julia_types::{__BindgenBitfieldUnit, mmtk_jl_ucontext_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] From d24f52e6561eeac604300d6596a554a91a6b3b9b Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 25 Sep 2024 02:56:16 +0000 Subject: [PATCH 06/32] Adding changes to support getter for jl_gc_disable_counter and using jl_small_typeof instead of internal version --- julia/mmtk_julia.c | 2 ++ mmtk/api/mmtk.h | 1 + mmtk/src/collection.rs | 8 ++------ mmtk/src/julia_scanning.rs | 6 +++--- mmtk/src/lib.rs | 1 + mmtk/src/object_model.rs | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index 5a4ec17e..7b033e11 100644 --- a/julia/mmtk_julia.c +++ b/julia/mmtk_julia.c @@ -28,6 +28,7 @@ extern void jl_gc_wait_for_the_world(jl_ptls_t* gc_all_tls_states, int gc_n_thre 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); @@ -540,6 +541,7 @@ 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/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/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 97073ada..c767c278 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -28,7 +28,7 @@ extern "C" { pub static jl_symbol_type: *const mmtk_jl_datatype_t; pub static jl_method_type: *const mmtk_jl_datatype_t; pub static jl_binding_partition_type: *const mmtk_jl_datatype_t; - pub static mut ijl_small_typeof: [*mut mmtk_jl_datatype_t; 128usize]; + pub static mut jl_small_typeof: [*mut mmtk_jl_datatype_t; 128usize]; } #[inline(always)] @@ -50,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::(); @@ -88,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 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!( From 7873163ae8651230aac16de56971bf8ffc38e72d Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 25 Sep 2024 02:57:01 +0000 Subject: [PATCH 07/32] Updating julia_version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 3eaeb540..da05c473 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/udesou/julia.git" -julia_version = "74edc2ba7fca698381c6dd154d154d464ba256d2" +julia_version = "50a94d9ec9e8a7cf39fefb2f9ca9685a2d2c6f58" [lib] crate-type = ["cdylib"] From 8f0ceed32fd67db49fa727da7c452b48a1ccc3c2 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 25 Sep 2024 04:07:17 +0000 Subject: [PATCH 08/32] Updating julia_version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index da05c473..ba99ecba 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/udesou/julia.git" -julia_version = "50a94d9ec9e8a7cf39fefb2f9ca9685a2d2c6f58" +julia_version = "c283442edf340d882b13c9ec887a6d9bd44b2527" [lib] crate-type = ["cdylib"] From 552883a9b71f890017b36f5f5539905d7b6956db Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Tue, 8 Oct 2024 23:28:34 +0000 Subject: [PATCH 09/32] Updating rust version to 1.77.0 --- mmtk/rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 7793910e04227d42accbeb1d6a843dfb208f42dc Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 9 Oct 2024 00:02:30 +0000 Subject: [PATCH 10/32] Merging refactor-pre-mmtk branch from julia and reflecting those changes in the binding --- julia/mmtk_julia.c | 22 +- julia/mmtk_julia_types.h | 14 +- mmtk/src/julia_types.rs | 6359 ++++++++------------------------------ mmtk/src/scanning.rs | 4 +- mmtk/src/util.rs | 4 +- 5 files changed, 1237 insertions(+), 5166 deletions(-) diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index 7b033e11..0e04d851 100644 --- a/julia/mmtk_julia.c +++ b/julia/mmtk_julia.c @@ -65,8 +65,8 @@ static void mmtk_sweep_malloced_memory(void) JL_NOTSAFEPOINT void* iter = new_mutator_iterator(); jl_ptls_t ptls2 = get_next_mutator_tls(iter); while(ptls2 != NULL) { - mallocmemory_t *ma = ptls2->gc_tls.heap.mallocarrays; - mallocmemory_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) { mallocmemory_t *nxt = ma->next; jl_value_t *a = (jl_value_t*)((uintptr_t)ma->a & ~1); @@ -85,8 +85,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; } @@ -116,8 +116,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; @@ -373,7 +373,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 @@ -395,10 +395,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; @@ -533,8 +533,8 @@ 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) { diff --git a/julia/mmtk_julia_types.h b/julia/mmtk_julia_types.h index 79c2244a..3bc7a03f 100644 --- a/julia/mmtk_julia_types.h +++ b/julia/mmtk_julia_types.h @@ -263,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; @@ -364,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 @@ -379,7 +381,7 @@ typedef struct { #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; @@ -421,12 +423,15 @@ typedef struct { } mmtk_jl_gc_mark_cache_t; typedef struct { - mmtk_jl_thread_heap_t heap; - mmtk_jl_thread_gc_num_t gc_num; 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; @@ -458,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; diff --git a/mmtk/src/julia_types.rs b/mmtk/src/julia_types.rs index 4dec06e8..e38d1831 100644 --- a/mmtk/src/julia_types.rs +++ b/mmtk/src/julia_types.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -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,79 +2330,29 @@ 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)] #[derive(Debug, Copy, Clone)] @@ -4220,19 +2360,13 @@ pub struct mmtk__jl_taggedvalue_bits { pub _bitfield_align_1: [u64; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } -#[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)) - ); -} +#[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 { @@ -4325,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 { @@ -4416,25 +2496,13 @@ 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 { @@ -4539,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 { @@ -4635,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 { @@ -4867,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 { @@ -4906,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 { @@ -5183,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 { @@ -5309,51 +3037,17 @@ 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)] @@ -5365,72 +3059,23 @@ pub struct mmtk__jl_binding_partition_t { pub next: u64, pub reserved: usize, } -#[test] -fn bindgen_test_layout_mmtk__jl_binding_partition_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_partition_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk__jl_binding_partition_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).restriction) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_binding_partition_t), - "::", - stringify!(restriction) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).min_world) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_binding_partition_t), - "::", - stringify!(min_world) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_world) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_binding_partition_t), - "::", - stringify!(max_world) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_binding_partition_t), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_binding_partition_t), - "::", - stringify!(reserved) - ) - ); -} +#[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)] @@ -5442,51 +3087,17 @@ pub struct mmtk_jl_binding_t { 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::(), - 32usize, - 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).globalref) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_binding_t), - "::", - stringify!(globalref) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_binding_t), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partitions) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_binding_t), - "::", - stringify!(partitions) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mmtk_jl_binding_t"][::std::mem::size_of::() - 32usize]; + ["Alignment of mmtk_jl_binding_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: mmtk_jl_binding_t::globalref"] + [::std::mem::offset_of!(mmtk_jl_binding_t, globalref) - 0usize]; + ["Offset of field: mmtk_jl_binding_t::value"] + [::std::mem::offset_of!(mmtk_jl_binding_t, value) - 8usize]; + ["Offset of field: mmtk_jl_binding_t::partitions"] + [::std::mem::offset_of!(mmtk_jl_binding_t, partitions) - 16usize]; +}; impl mmtk_jl_binding_t { #[inline] pub fn declared(&self) -> u8 { @@ -5582,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 { @@ -5635,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 { @@ -5698,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 { @@ -5843,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, @@ -5856,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)] @@ -6038,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 { @@ -6084,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)] @@ -6143,32 +3388,15 @@ 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)] @@ -6186,80 +3414,26 @@ pub union mmtk_jl_ucontext_t__bindgen_ty_1 { pub ctx: *mut mmtk__jl_ucontext_t, pub copy_ctx: *mut mmtk_jl_stack_context_t, } -#[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::(), - 8usize, - 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() { - 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!(mmtk_jl_ucontext_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(mmtk_jl_ucontext_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stkbuf) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_ucontext_t), - "::", - stringify!(stkbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bufsz) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_ucontext_t), - "::", - stringify!(bufsz) - ) - ); -} +#[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 { @@ -6307,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 { @@ -6349,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, @@ -6406,177 +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 _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::(), - 1168usize, - 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).free_stacks) as usize - ptr as usize }, - 144usize, - 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))] @@ -6588,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)] @@ -6641,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 { @@ -6726,125 +3632,54 @@ 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)] pub struct mmtk_jl_gc_tls_states_t { - pub heap: mmtk_jl_thread_heap_t, - pub gc_num: mmtk_jl_thread_gc_num_t, pub mmtk_mutator: MMTkMutatorContext, pub malloc_sz_since_last_poll: usize, } -#[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::(), - 1936usize, - concat!("Size of: ", stringify!(mmtk_jl_gc_tls_states_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - 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).gc_num) as usize - ptr as usize }, - 1168usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(gc_num) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mmtk_mutator) as usize - ptr as usize }, - 1232usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(mmtk_mutator) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc_sz_since_last_poll) as usize - ptr as usize }, - 1928usize, - concat!( - "Offset of field: ", - stringify!(mmtk_jl_gc_tls_states_t), - "::", - stringify!(malloc_sz_since_last_poll) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mmtk_jl_gc_tls_states_t"] + [::std::mem::size_of::() - 704usize]; + ["Alignment of mmtk_jl_gc_tls_states_t"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: mmtk_jl_gc_tls_states_t::mmtk_mutator"] + [::std::mem::offset_of!(mmtk_jl_gc_tls_states_t, mmtk_mutator) - 0usize]; + ["Offset of field: mmtk_jl_gc_tls_states_t::malloc_sz_since_last_poll"] + [::std::mem::offset_of!(mmtk_jl_gc_tls_states_t, malloc_sz_since_last_poll) - 696usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mmtk_jl_gc_tls_states_common_t { + pub heap: mmtk_jl_thread_heap_common_t, + pub gc_num: mmtk_jl_thread_gc_num_common_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mmtk_jl_gc_tls_states_common_t"] + [::std::mem::size_of::() - 1232usize]; + ["Alignment of mmtk_jl_gc_tls_states_common_t"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: mmtk_jl_gc_tls_states_common_t::heap"] + [::std::mem::offset_of!(mmtk_jl_gc_tls_states_common_t, heap) - 0usize]; + ["Offset of field: mmtk_jl_gc_tls_states_common_t::gc_num"] + [::std::mem::offset_of!(mmtk_jl_gc_tls_states_common_t, gc_num) - 1168usize]; +}; #[repr(C)] pub struct mmtk__jl_tls_states_t { pub tid: i16, @@ -6858,6 +3693,7 @@ pub struct mmtk__jl_tls_states_t { pub disable_gc: i16, pub finalizers_inhibited: ::std::os::raw::c_int, pub gc_tls: mmtk_jl_gc_tls_states_t, + pub gc_tls_common: mmtk_jl_gc_tls_states_common_t, pub defer_signal: sig_atomic_t, pub current_task: u64, pub next_task: *mut mmtk__jl_task_t, @@ -6881,352 +3717,80 @@ pub struct mmtk__jl_tls_states_t { pub locks: mmtk_small_arraylist_t, pub engine_nqueued: usize, } -#[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::(), - 2448usize, - concat!("Size of: ", stringify!(mmtk__jl_tls_states_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - 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 }, - 40usize, - 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 }, - 1976usize, - 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 }, - 1984usize, - 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 }, - 1992usize, - 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 }, - 2000usize, - 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 }, - 2008usize, - 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 }, - 2016usize, - 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 }, - 2024usize, - 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 }, - 2032usize, - 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 }, - 2040usize, - 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 }, - 2048usize, - 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 }, - 2056usize, - 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 }, - 2064usize, - 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 }, - 2072usize, - 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 }, - 2076usize, - 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 }, - 2080usize, - 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 }, - 2088usize, - 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 }, - 2096usize, - 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 }, - 2104usize, - 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 }, - 2112usize, - 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 }, - 2368usize, - 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 }, - 2376usize, - 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 }, - 2440usize, - concat!( - "Offset of field: ", - stringify!(mmtk__jl_tls_states_t), - "::", - stringify!(engine_nqueued) - ) - ); -} +#[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)] @@ -7253,262 +3817,66 @@ pub struct mmtk__jl_task_t { pub eh: *mut ::std::os::raw::c_void, pub ctx: mmtk_jl_ucontext_t, } -#[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::(), - 184usize, - 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) - ) - ); -} +#[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 { @@ -7522,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 { @@ -7714,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)] @@ -7787,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; diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index 859355b7..da721240 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -81,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 df1e4780..8ea72b2d 100644 --- a/mmtk/src/util.rs +++ b/mmtk/src/util.rs @@ -73,8 +73,8 @@ 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 From 56b2542c9904aebdebf9f4a99f48861973defa18 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 9 Oct 2024 00:03:07 +0000 Subject: [PATCH 11/32] Updating julia_version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index ba99ecba..e9e3ad04 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/udesou/julia.git" -julia_version = "c283442edf340d882b13c9ec887a6d9bd44b2527" +julia_version = "380fd833efba491cb167ad9c61909199e14098d8" [lib] crate-type = ["cdylib"] From a41daddbf0a783db67175f4cfd140f1c0eead69d Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 10 Oct 2024 00:48:36 +0000 Subject: [PATCH 12/32] Only run tests for non-moving immix --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8341d3e5..a9d6519e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,8 @@ jobs: strategy: fail-fast: false matrix: - gc_plan: [Immix, StickyImmix] - moving: [Default, Non_Moving] + gc_plan: [Immix] + moving: [Non_Moving] uses: ./.github/workflows/binding-tests.yml with: gc_plan: ${{ matrix.gc_plan }} From 91d43ec50a622c3837cd823005f2e52f26736210 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 10 Oct 2024 02:01:29 +0000 Subject: [PATCH 13/32] Update julia_version and ci.yml --- .github/workflows/ci.yml | 1 + mmtk/Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9d6519e..ec947074 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 + - upstream-ready/immix concurrency: # Cancels pending runs when a PR gets updated. diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index e9e3ad04..056bbb01 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -9,8 +9,8 @@ edition = "2018" # Metadata for the Julia repository [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/udesou/julia.git" -julia_version = "380fd833efba491cb167ad9c61909199e14098d8" +julia_repo = "https://github.com/mmtk/julia.git" +julia_version = "f4eba6b1dbe4bf3d66ff9de33953a80d6afb0d07" [lib] crate-type = ["cdylib"] From 7690691f2bf2416ac59bc92c8876b7aaa9727965 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 10 Oct 2024 02:07:38 +0000 Subject: [PATCH 14/32] Updating julia_version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 056bbb01..867c98e5 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 = "f4eba6b1dbe4bf3d66ff9de33953a80d6afb0d07" +julia_version = "c20ecb31d11a4ce7354d05ae5e49ffc91714901f" [lib] crate-type = ["cdylib"] From da9ff0d97a8abf4be86cab6dddda0d1584779f5c Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 10 Oct 2024 04:33:08 +0000 Subject: [PATCH 15/32] Skipping tests that check the reasons for a full sweep and are specific to stock Julia --- .github/scripts/ci-test-patching.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/scripts/ci-test-patching.sh b/.github/scripts/ci-test-patching.sh index 6542c799..192feef1 100755 --- a/.github/scripts/ci-test-patching.sh +++ b/.github/scripts/ci-test-patching.sh @@ -38,6 +38,10 @@ 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" From 61e1cfdf1046bbd8e6f64b920a223c613a142cb6 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Sun, 13 Oct 2024 23:40:01 +0000 Subject: [PATCH 16/32] Adding comments on new functions --- julia/mmtk_julia.c | 3 +++ mmtk/src/julia_scanning.rs | 42 +++++--------------------------------- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index 0e04d851..ed7cd44e 100644 --- a/julia/mmtk_julia.c +++ b/julia/mmtk_julia.c @@ -46,6 +46,9 @@ JL_DLLEXPORT void (jl_mmtk_harness_end)(void) mmtk_harness_end(); } +// This is used in mmtk_sweep_malloced_memory and it is slightly different +// from jl_gc_free_memory from gc-stock.c as the stock GC updates the +// information in the global variable gc_heap_stats (which is specific to the stock GC) static void jl_gc_free_memory(jl_value_t *v, int isaligned) JL_NOTSAFEPOINT { assert(jl_is_genericmemory(v)); diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index c767c278..d87ac27f 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -532,43 +532,9 @@ 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); -// } - -// #[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); -// } - +// 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")] @@ -581,6 +547,8 @@ pub fn mmtk_decode_restriction_value(pku: u64) -> usize { #[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; } } From 60c3d5889e8b6c463e48090ac4f4bee1f12c62ed Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 04:40:43 +0000 Subject: [PATCH 17/32] Removing julia folder and using build.rs to generate bindings --- julia/mmtk_julia.c | 565 ---- julia/mmtk_julia.h | 8 - julia/mmtk_julia_types.h | 688 ----- mmtk/Cargo.lock | 89 + mmtk/Cargo.toml | 4 +- mmtk/api/mmtk.h | 38 +- mmtk/src/active_plan.rs | 8 +- mmtk/src/api.rs | 11 - mmtk/src/collection.rs | 18 +- mmtk/src/julia_finalizer.rs | 18 +- mmtk/src/julia_scanning.rs | 150 +- mmtk/src/julia_types.rs | 4829 +++++++++-------------------------- mmtk/src/lib.rs | 48 +- mmtk/src/object_model.rs | 65 +- mmtk/src/reference_glue.rs | 10 +- mmtk/src/scanning.rs | 21 +- mmtk/src/util.rs | 47 +- 17 files changed, 1476 insertions(+), 5141 deletions(-) delete mode 100644 julia/mmtk_julia.c delete mode 100644 julia/mmtk_julia.h delete mode 100644 julia/mmtk_julia_types.h diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c deleted file mode 100644 index ed7cd44e..00000000 --- a/julia/mmtk_julia.c +++ /dev/null @@ -1,565 +0,0 @@ -#include "mmtk_julia.h" -#include "mmtk.h" -#include "gc-mmtk.h" -#include "mmtk_julia_types.h" -#include -#include -#include "gc-common.h" -#include "threading.h" - -extern int64_t perm_scanned_bytes; -extern void run_finalizer(jl_task_t *ct, void *o, void *ff); -extern int gc_n_threads; -extern jl_ptls_t* gc_all_tls_states; -extern jl_value_t *cmpswap_names JL_GLOBALLY_ROOTED; -extern jl_genericmemory_t *jl_global_roots_list JL_GLOBALLY_ROOTED; -extern jl_genericmemory_t *jl_global_roots_keyset JL_GLOBALLY_ROOTED; -extern jl_typename_t *jl_array_typename JL_GLOBALLY_ROOTED; -extern long BI_METADATA_START_ALIGNED_DOWN; -extern long BI_METADATA_END_ALIGNED_UP; -extern uint64_t finalizer_rngState[JL_RNG_SIZE]; -extern const unsigned pool_sizes[]; -extern size_t mmtk_get_obj_size(void* obj); -extern void jl_rng_split(uint64_t to[JL_RNG_SIZE], uint64_t from[JL_RNG_SIZE]); -extern void _jl_free_stack(jl_ptls_t ptls, void *stkbuf, size_t bufsz); -extern void free_stack(void *stkbuf, size_t bufsz); -extern jl_mutex_t finalizers_lock; -extern void jl_gc_wait_for_the_world(jl_ptls_t* gc_all_tls_states, int gc_n_threads); -extern void mmtk_block_thread_for_gc(void); -extern int64_t live_bytes; -extern void jl_throw_out_of_memory_error(void); -extern uint32_t jl_get_gc_disable_counter(void); - - -extern void* new_mutator_iterator(void); -extern jl_ptls_t get_next_mutator_tls(void*); -extern void* close_mutator_iterator(void*); - -JL_DLLEXPORT void (jl_mmtk_harness_begin)(void) -{ - jl_ptls_t ptls = jl_current_task->ptls; - mmtk_harness_begin(ptls); -} - -JL_DLLEXPORT void (jl_mmtk_harness_end)(void) -{ - mmtk_harness_end(); -} - -// This is used in mmtk_sweep_malloced_memory and it is slightly different -// from jl_gc_free_memory from gc-stock.c as the stock GC updates the -// information in the global variable gc_heap_stats (which is specific to the stock GC) -static void jl_gc_free_memory(jl_value_t *v, int isaligned) JL_NOTSAFEPOINT -{ - assert(jl_is_genericmemory(v)); - jl_genericmemory_t *m = (jl_genericmemory_t*)v; - assert(jl_genericmemory_how(m) == 1 || jl_genericmemory_how(m) == 2); - char *d = (char*)m->ptr; - if (isaligned) - jl_free_aligned(d); - else - free(d); - gc_num.freed += jl_genericmemory_nbytes(m); - gc_num.freecall++; -} - -static void mmtk_sweep_malloced_memory(void) JL_NOTSAFEPOINT -{ - void* iter = new_mutator_iterator(); - jl_ptls_t ptls2 = get_next_mutator_tls(iter); - while(ptls2 != NULL) { - mallocmemory_t *ma = ptls2->gc_tls_common.heap.mallocarrays; - mallocmemory_t **pma = &ptls2->gc_tls_common.heap.mallocarrays; - while (ma != NULL) { - mallocmemory_t *nxt = ma->next; - jl_value_t *a = (jl_value_t*)((uintptr_t)ma->a & ~1); - if (!mmtk_object_is_managed_by_mmtk(a)) { - pma = &ma->next; - ma = nxt; - continue; - } - if (mmtk_is_live_object(a)) { - // if the array has been forwarded, the reference needs to be updated - jl_genericmemory_t *maybe_forwarded = (jl_genericmemory_t*)mmtk_get_possibly_forwared(ma->a); - ma->a = maybe_forwarded; - pma = &ma->next; - } - else { - *pma = nxt; - int isaligned = (uintptr_t)ma->a & 1; - jl_gc_free_memory(a, isaligned); - ma->next = ptls2->gc_tls_common.heap.mafreelist; - ptls2->gc_tls_common.heap.mafreelist = ma; - } - ma = nxt; - } - ptls2 = get_next_mutator_tls(iter); - } - gc_sweep_sysimg(); - close_mutator_iterator(iter); -} - -void mmtk_wait_in_a_safepoint(void) { - jl_ptls_t ptls = jl_current_task->ptls; - jl_gc_safepoint_(ptls); -} - -void mmtk_exit_from_safepoint(int8_t old_state) { - jl_ptls_t ptls = jl_current_task->ptls; - jl_gc_state_set(ptls, old_state, JL_GC_STATE_WAITING); -} - -// based on jl_gc_collect from gc.c -JL_DLLEXPORT void jl_gc_prepare_to_collect(void) -{ - // FIXME: set to JL_GC_AUTO since we're calling it from mmtk - // maybe just remove this? - JL_PROBE_GC_BEGIN(JL_GC_AUTO); - - jl_task_t *ct = jl_current_task; - jl_ptls_t ptls = ct->ptls; - if (jl_atomic_load_acquire(&jl_gc_disable_counter)) { - size_t localbytes = jl_atomic_load_relaxed(&ptls->gc_tls_common.gc_num.allocd) + gc_num.interval; - jl_atomic_store_relaxed(&ptls->gc_tls_common.gc_num.allocd, -(int64_t)gc_num.interval); - static_assert(sizeof(_Atomic(uint64_t)) == sizeof(gc_num.deferred_alloc), ""); - jl_atomic_fetch_add_relaxed((_Atomic(uint64_t)*)&gc_num.deferred_alloc, localbytes); - return; - } - - int8_t old_state = jl_atomic_load_relaxed(&ptls->gc_state); - jl_atomic_store_release(&ptls->gc_state, JL_GC_STATE_WAITING); - // `jl_safepoint_start_gc()` makes sure only one thread can run the GC. - uint64_t t0 = jl_hrtime(); - if (!jl_safepoint_start_gc()) { - jl_gc_state_set(ptls, old_state, JL_GC_STATE_WAITING); - jl_safepoint_wait_thread_resume(); // block in thread-suspend now if requested, after clearing the gc_state - return; - } - - JL_TIMING_SUSPEND_TASK(GC, ct); - JL_TIMING(GC, GC); - - int last_errno = errno; -#ifdef _OS_WINDOWS_ - DWORD last_error = GetLastError(); -#endif - // Now we are ready to wait for other threads to hit the safepoint, - // we can do a few things that doesn't require synchronization. - // - // We must sync here with the tls_lock operations, so that we have a - // seq-cst order between these events now we know that either the new - // thread must run into our safepoint flag or we must observe the - // existence of the thread in the jl_n_threads count. - // - // TODO: concurrently queue objects - jl_fence(); - gc_n_threads = jl_atomic_load_acquire(&jl_n_threads); - gc_all_tls_states = jl_atomic_load_relaxed(&jl_all_tls_states); - jl_gc_wait_for_the_world(gc_all_tls_states, gc_n_threads); - JL_PROBE_GC_STOP_THE_WORLD(); - - uint64_t t1 = jl_hrtime(); - uint64_t duration = t1 - t0; - if (duration > gc_num.max_time_to_safepoint) - gc_num.max_time_to_safepoint = duration; - gc_num.time_to_safepoint = duration; - gc_num.total_time_to_safepoint += duration; - - if (!jl_atomic_load_acquire(&jl_gc_disable_counter)) { - JL_LOCK_NOGC(&finalizers_lock); // all the other threads are stopped, so this does not make sense, right? otherwise, failing that, this seems like plausibly a deadlock -#ifndef __clang_gcanalyzer__ - mmtk_block_thread_for_gc(); -#endif - JL_UNLOCK_NOGC(&finalizers_lock); - } - - gc_n_threads = 0; - gc_all_tls_states = NULL; - jl_safepoint_end_gc(); - jl_gc_state_set(ptls, old_state, JL_GC_STATE_WAITING); - JL_PROBE_GC_END(); - jl_safepoint_wait_thread_resume(); // block in thread-suspend now if requested, after clearing the gc_state - - // Only disable finalizers on current thread - // Doing this on all threads is racy (it's impossible to check - // or wait for finalizers on other threads without dead lock). - if (!ptls->finalizers_inhibited && ptls->locks.len == 0) { - JL_TIMING(GC, GC_Finalizers); - run_finalizers(ct, 0); - } - JL_PROBE_GC_FINALIZER(); - -#ifdef _OS_WINDOWS_ - SetLastError(last_error); -#endif - errno = last_errno; -} - -extern void run_finalizers(jl_task_t *ct, int finalizers_thread); - -// We implement finalization in the binding side. These functions -// returns some pointers so MMTk can manipulate finalizer lists. - -extern jl_mutex_t finalizers_lock; -extern arraylist_t to_finalize; -extern arraylist_t finalizer_list_marked; - -void* get_thread_finalizer_list(void* ptls_raw) { - jl_ptls_t ptls = (jl_ptls_t) ptls_raw; - return (void*)&ptls->finalizers; -} - -void* get_to_finalize_list(void) { - return (void*)&to_finalize; -} - -void* get_marked_finalizers_list(void) { - return (void*)&finalizer_list_marked; -} - -int* get_jl_gc_have_pending_finalizers(void) { - return (int*)&jl_gc_have_pending_finalizers; -} - -static void add_node_to_roots_buffer(RootsWorkClosure* closure, RootsWorkBuffer* buf, size_t* buf_len, void* root) { - if (root == NULL) - return; - - buf->ptr[*buf_len] = root; - *buf_len += 1; - if (*buf_len >= buf->cap) { - RootsWorkBuffer new_buf = (closure->report_nodes_func)(buf->ptr, *buf_len, buf->cap, closure->data, true); - *buf = new_buf; - *buf_len = 0; - } -} - -static void add_node_to_tpinned_roots_buffer(RootsWorkClosure* closure, RootsWorkBuffer* buf, size_t* buf_len, void* root) { - if (root == NULL) - return; - - buf->ptr[*buf_len] = root; - *buf_len += 1; - if (*buf_len >= buf->cap) { - RootsWorkBuffer new_buf = (closure->report_tpinned_nodes_func)(buf->ptr, *buf_len, buf->cap, closure->data, true); - *buf = new_buf; - *buf_len = 0; - } -} - -void scan_vm_specific_roots(RootsWorkClosure* closure) -{ - // Create a new buf - RootsWorkBuffer buf = (closure->report_nodes_func)((void**)0, 0, 0, closure->data, true); - size_t len = 0; - - // add module - add_node_to_roots_buffer(closure, &buf, &len, jl_main_module); - - // buildin values - add_node_to_roots_buffer(closure, &buf, &len, jl_an_empty_vec_any); - add_node_to_roots_buffer(closure, &buf, &len, jl_module_init_order); - for (size_t i = 0; i < jl_current_modules.size; i += 2) { - if (jl_current_modules.table[i + 1] != HT_NOTFOUND) { - add_node_to_roots_buffer(closure, &buf, &len, jl_current_modules.table[i]); - } - } - add_node_to_roots_buffer(closure, &buf, &len, jl_anytuple_type_type); - for (size_t i = 0; i < N_CALL_CACHE; i++) { - jl_typemap_entry_t *v = jl_atomic_load_relaxed(&call_cache[i]); - add_node_to_roots_buffer(closure, &buf, &len, v); - } - add_node_to_roots_buffer(closure, &buf, &len, _jl_debug_method_invalidation); - - // constants - add_node_to_roots_buffer(closure, &buf, &len, jl_emptytuple_type); - add_node_to_roots_buffer(closure, &buf, &len, cmpswap_names); - - // jl_global_roots_table must be transitively pinned - RootsWorkBuffer tpinned_buf = (closure->report_tpinned_nodes_func)((void**)0, 0, 0, closure->data, true); - size_t tpinned_len = 0; - add_node_to_tpinned_roots_buffer(closure, &tpinned_buf, &tpinned_len, jl_global_roots_list); - add_node_to_tpinned_roots_buffer(closure, &tpinned_buf, &tpinned_len, jl_global_roots_keyset); - - // Push the result of the work. - (closure->report_nodes_func)(buf.ptr, len, buf.cap, closure->data, false); - (closure->report_tpinned_nodes_func)(tpinned_buf.ptr, tpinned_len, tpinned_buf.cap, closure->data, false); -} - -JL_DLLEXPORT void scan_julia_exc_obj(void* obj_raw, void* closure, ProcessSlotFn process_slot) { - jl_task_t *ta = (jl_task_t*)obj_raw; - - if (ta->excstack) { // inlining label `excstack` from mark_loop - // if it is not managed by MMTk, nothing needs to be done because the object does not need to be scanned - if (mmtk_object_is_managed_by_mmtk(ta->excstack)) { - process_slot(closure, &ta->excstack); - } - jl_excstack_t *excstack = ta->excstack; - size_t itr = ta->excstack->top; - size_t bt_index = 0; - size_t jlval_index = 0; - while (itr > 0) { - size_t bt_size = jl_excstack_bt_size(excstack, itr); - jl_bt_element_t *bt_data = jl_excstack_bt_data(excstack, itr); - for (; bt_index < bt_size; bt_index += jl_bt_entry_size(bt_data + bt_index)) { - jl_bt_element_t *bt_entry = bt_data + bt_index; - if (jl_bt_is_native(bt_entry)) - continue; - // Found an extended backtrace entry: iterate over any - // GC-managed values inside. - size_t njlvals = jl_bt_num_jlvals(bt_entry); - while (jlval_index < njlvals) { - jl_value_t** new_obj_slot = &bt_entry[2 + jlval_index].jlvalue; - jlval_index += 1; - process_slot(closure, new_obj_slot); - } - jlval_index = 0; - } - - jl_bt_element_t *stack_raw = (jl_bt_element_t *)(excstack+1); - jl_value_t** stack_obj_slot = &stack_raw[itr-1].jlvalue; - - itr = jl_excstack_next(excstack, itr); - bt_index = 0; - jlval_index = 0; - process_slot(closure, stack_obj_slot); - } - } -} - -// number of stacks to always keep available per pool - from gc-stacks.c -#define MIN_STACK_MAPPINGS_PER_POOL 5 - -#define jl_genericmemory_elsize(a) (((jl_datatype_t*)jl_typetagof(a))->layout->size) - -// if data is inlined inside the genericmemory object --- to->ptr needs to be updated when copying the array -void update_inlined_array(void* from, void* to) { - jl_value_t* jl_from = (jl_value_t*) from; - jl_value_t* jl_to = (jl_value_t*) to; - - uintptr_t tag_to = (uintptr_t)jl_typeof(jl_to); - jl_datatype_t *vt = (jl_datatype_t*)tag_to; - - if(vt->name == jl_genericmemory_typename) { - jl_genericmemory_t *a = (jl_genericmemory_t*)jl_from; - jl_genericmemory_t *b = (jl_genericmemory_t*)jl_to; - int how = jl_genericmemory_how(a); - - if (how == 0 && mmtk_object_is_managed_by_mmtk(a->ptr)) { // a is inlined (a->ptr points into the mmtk object) - size_t offset_of_data = ((size_t)a->ptr - (size_t)a); - if (offset_of_data > 0) { - b->ptr = (void*)((size_t) b + offset_of_data); - } - } - } -} - -// modified sweep_stack_pools from gc-stacks.c -void mmtk_sweep_stack_pools(void) -{ - // Stack sweeping algorithm: - // // deallocate stacks if we have too many sitting around unused - // for (stk in halfof(free_stacks)) - // free_stack(stk, pool_sz); - // // then sweep the task stacks - // for (t in live_tasks) - // if (!gc-marked(t)) - // stkbuf = t->stkbuf - // bufsz = t->bufsz - // if (stkbuf) - // push(free_stacks[sz], stkbuf) - assert(gc_n_threads); - for (int i = 0; i < jl_n_threads; i++) { - jl_ptls_t ptls2 = gc_all_tls_states[i]; - if (ptls2 == NULL) - continue; - - // free half of stacks that remain unused since last sweep - for (int p = 0; p < JL_N_STACK_POOLS; p++) { - small_arraylist_t *al = &ptls2->gc_tls_common.heap.free_stacks[p]; - size_t n_to_free; - if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) { - n_to_free = al->len; // not alive yet or dead, so it does not need these anymore - } - else if (al->len > MIN_STACK_MAPPINGS_PER_POOL) { - n_to_free = al->len / 2; - if (n_to_free > (al->len - MIN_STACK_MAPPINGS_PER_POOL)) - n_to_free = al->len - MIN_STACK_MAPPINGS_PER_POOL; - } - else { - n_to_free = 0; - } - for (int n = 0; n < n_to_free; n++) { - void *stk = small_arraylist_pop(al); - free_stack(stk, pool_sizes[p]); - } - if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) { - small_arraylist_free(al); - } - } - if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) { - small_arraylist_free(ptls2->gc_tls_common.heap.free_stacks); - } - - small_arraylist_t *live_tasks = &ptls2->gc_tls_common.heap.live_tasks; - size_t n = 0; - size_t ndel = 0; - size_t l = live_tasks->len; - void **lst = live_tasks->items; - if (l == 0) - continue; - while (1) { - jl_task_t *t = (jl_task_t*)lst[n]; - if (mmtk_is_live_object(t)) { - jl_task_t *maybe_forwarded = (jl_task_t*)mmtk_get_possibly_forwared(t); - live_tasks->items[n] = maybe_forwarded; - t = maybe_forwarded; - assert(jl_is_task(t)); - if (t->ctx.stkbuf == NULL) - ndel++; // jl_release_task_stack called - else - n++; - } else { - ndel++; - void *stkbuf = t->ctx.stkbuf; - size_t bufsz = t->ctx.bufsz; - if (stkbuf) { - t->ctx.stkbuf = NULL; - _jl_free_stack(ptls2, stkbuf, bufsz); - } -#ifdef _COMPILER_TSAN_ENABLED_ - if (t->ctx.tsan_state) { - __tsan_destroy_fiber(t->ctx.tsan_state); - t->ctx.tsan_state = NULL; - } -#endif - } - if (n >= l - ndel) - break; - void *tmp = lst[n]; - lst[n] = lst[n + ndel]; - lst[n + ndel] = tmp; - } - live_tasks->len -= ndel; - } -} - -JL_DLLEXPORT void* get_stackbase(int16_t tid) { - assert(tid >= 0); - jl_ptls_t ptls2 = jl_all_tls_states[tid]; - return ptls2->stackbase; -} - -const bool PRINT_OBJ_TYPE = false; - -void update_gc_stats(uint64_t inc, size_t mmtk_live_bytes, bool is_nursery_gc) { - gc_num.total_time += inc; - gc_num.pause += 1; - gc_num.full_sweep += !(is_nursery_gc); - gc_num.total_allocd += gc_num.allocd; - gc_num.allocd = 0; - live_bytes = mmtk_live_bytes; -} - -#define assert_size(ty_a, ty_b) \ - if(sizeof(ty_a) != sizeof(ty_b)) {\ - printf("%s size = %ld, %s size = %ld. Need to update our type definition.\n", #ty_a, sizeof(ty_a), #ty_b, sizeof(ty_b));\ - exit(1); \ - } - -#define PRINT_STRUCT_SIZE false -#define print_sizeof(type) (PRINT_STRUCT_SIZE ? (printf("C " #type " = %zu bytes\n", sizeof(type)), sizeof(type)) : sizeof(type)) - -#define jl_genericmemory_data_owner_field_addr(a) ((jl_value_t**)((jl_genericmemory_t*)(a) + 1)) - -void* jl_get_owner_address_to_mmtk(void* m) { - return (void*)jl_genericmemory_data_owner_field_addr(m); -} - -size_t mmtk_jl_genericmemory_how(void *arg) JL_NOTSAFEPOINT -{ - jl_genericmemory_t* m = (jl_genericmemory_t*)arg; - if (m->ptr == (void*)((char*)m + 16)) // JL_SMALL_BYTE_ALIGNMENT (from julia_internal.h) - return 0; - jl_value_t *owner = jl_genericmemory_data_owner_field(m); - if (owner == (jl_value_t*)m) - return 1; - if (owner == NULL) - return 2; - return 3; -} - - -uintptr_t get_abi_structs_checksum_c(void) { - assert_size(struct mmtk__jl_taggedvalue_bits, struct _jl_taggedvalue_bits); - assert_size(mmtk_jl_taggedvalue_t, jl_taggedvalue_t); - assert_size(mmtk_jl_datatype_layout_t, jl_datatype_layout_t); - assert_size(mmtk_jl_typename_t, jl_typename_t); - assert_size(mmtk_jl_svec_t, jl_svec_t); - assert_size(mmtk_jl_datatype_t, jl_datatype_t); - assert_size(mmtk_jl_array_t, jl_array_t); - assert_size(mmtk_jl_sym_t, jl_sym_t); - assert_size(mmtk_jl_binding_t, jl_binding_t); - assert_size(mmtk_htable_t, htable_t); - assert_size(mmtk_arraylist_t, arraylist_t); - assert_size(mmtk_jl_uuid_t, jl_uuid_t); - assert_size(mmtk_jl_mutex_t, jl_mutex_t); - assert_size(mmtk_jl_module_t, jl_module_t); - assert_size(mmtk_jl_excstack_t, jl_excstack_t); - assert_size(mmtk_jl_bt_element_t, jl_bt_element_t); - assert_size(mmtk_jl_stack_context_t, jl_stack_context_t); - assert_size(mmtk_jl_ucontext_t, jl_ucontext_t); - assert_size(struct mmtk__jl_gcframe_t, struct _jl_gcframe_t); - assert_size(mmtk_jl_task_t, jl_task_t); - assert_size(mmtk_jl_weakref_t, jl_weakref_t); - - return print_sizeof(MMTkMutatorContext) - ^ print_sizeof(struct mmtk__jl_taggedvalue_bits) - ^ print_sizeof(mmtk_jl_taggedvalue_t) - ^ print_sizeof(mmtk_jl_datatype_layout_t) - ^ print_sizeof(mmtk_jl_typename_t) - ^ print_sizeof(mmtk_jl_svec_t) - ^ print_sizeof(mmtk_jl_datatype_t) - ^ print_sizeof(mmtk_jl_array_t) - ^ print_sizeof(mmtk_jl_sym_t) - ^ print_sizeof(mmtk_jl_binding_t) - ^ print_sizeof(mmtk_htable_t) - ^ print_sizeof(mmtk_arraylist_t) - ^ print_sizeof(mmtk_jl_uuid_t) - ^ print_sizeof(mmtk_jl_mutex_t) - ^ print_sizeof(mmtk_jl_module_t) - ^ print_sizeof(mmtk_jl_excstack_t) - ^ print_sizeof(mmtk_jl_bt_element_t) - ^ print_sizeof(mmtk_jl_stack_context_t) - ^ print_sizeof(mmtk_jl_ucontext_t) - ^ print_sizeof(struct mmtk__jl_gcframe_t) - ^ print_sizeof(mmtk_jl_task_t) - ^ print_sizeof(mmtk_jl_weakref_t) - ^ print_sizeof(mmtk_jl_tls_states_t) - ^ print_sizeof(mmtk_jl_thread_heap_common_t) - ^ print_sizeof(mmtk_jl_thread_gc_num_common_t); -} - -Julia_Upcalls mmtk_upcalls = (Julia_Upcalls) { - .scan_julia_exc_obj = scan_julia_exc_obj, - .get_stackbase = get_stackbase, - .jl_throw_out_of_memory_error = jl_throw_out_of_memory_error, - .jl_get_gc_disable_counter = jl_get_gc_disable_counter, - .sweep_malloced_memory = mmtk_sweep_malloced_memory, - .sweep_stack_pools = mmtk_sweep_stack_pools, - .wait_in_a_safepoint = mmtk_wait_in_a_safepoint, - .exit_from_safepoint = mmtk_exit_from_safepoint, - .jl_hrtime = jl_hrtime, - .update_gc_stats = update_gc_stats, - .get_abi_structs_checksum_c = get_abi_structs_checksum_c, - .get_thread_finalizer_list = get_thread_finalizer_list, - .get_to_finalize_list = get_to_finalize_list, - .get_marked_finalizers_list = get_marked_finalizers_list, - .arraylist_grow = (void (*)(void*, long unsigned int))arraylist_grow, - .get_jl_gc_have_pending_finalizers = get_jl_gc_have_pending_finalizers, - .scan_vm_specific_roots = scan_vm_specific_roots, - .update_inlined_array = update_inlined_array, - .prepare_to_collect = jl_gc_prepare_to_collect, - .get_owner_address = jl_get_owner_address_to_mmtk, - .mmtk_genericmemory_how = mmtk_jl_genericmemory_how, -}; diff --git a/julia/mmtk_julia.h b/julia/mmtk_julia.h deleted file mode 100644 index 6c8c80d5..00000000 --- a/julia/mmtk_julia.h +++ /dev/null @@ -1,8 +0,0 @@ -#include "mmtk.h" -#include "gc-common.h" - -extern Julia_Upcalls mmtk_upcalls; - -int set_gc_running_state(jl_ptls_t ptls); -void mmtk_jl_gc_run_all_finalizers(void); -void mmtk_jl_run_pending_finalizers(void* tls); diff --git a/julia/mmtk_julia_types.h b/julia/mmtk_julia_types.h deleted file mode 100644 index 3bc7a03f..00000000 --- a/julia/mmtk_julia_types.h +++ /dev/null @@ -1,688 +0,0 @@ -// install bindgen with cargo install bindgen-cli -// run: -// BINDGEN_EXTRA_CLANG_ARGS="-I mmtk/api" ~/.cargo/bin/bindgen julia/mmtk_julia_types.h --opaque-type MMTkMutatorContext -o mmtk/src/julia_types.rs -- -x c++ -std=c++14 -#include -#include -#include -#include "mmtkMutator.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(_CPU_X86_64_) -# define _P64 -#elif defined(_CPU_X86_) -# define _P32 -#elif defined(_OS_WINDOWS_) -/* Not sure how to determine pointer size on Windows running ARM. */ -# if _WIN64 -# define _P64 -# else -# define _P32 -# endif -#elif __SIZEOF_POINTER__ == 8 -# define _P64 -#elif __SIZEOF_POINTER__ == 4 -# define _P32 -#else -# error pointer size not known for your platform / compiler -#endif - -typedef __SIZE_TYPE__ size_t; -typedef int sig_atomic_t; - -struct mmtk__jl_taggedvalue_bits { - uintptr_t gc:2; - uintptr_t in_image:1; - uintptr_t unused:1; -#ifdef _P64 - uintptr_t tag:60; -#else - uintptr_t tag:28; -#endif -}; - -typedef struct mmtk__jl_value_t mmtk_jl_value_t; -typedef struct mmtk__jl_taggedvalue_t mmtk_jl_taggedvalue_t; - -struct mmtk__jl_taggedvalue_t { - union { - uintptr_t header; - mmtk_jl_taggedvalue_t *next; - mmtk_jl_value_t *type; // 16-byte aligned - struct mmtk__jl_taggedvalue_bits bits; - }; - // jl_value_t value; -}; - -typedef struct { - uint32_t size; - uint32_t nfields; - uint32_t npointers; // number of pointers embedded inside - int32_t first_ptr; // index of the first pointer (or -1) - uint16_t alignment; // strictest alignment over all fields - struct { // combine these fields into a struct so that we can take addressof them - uint16_t haspadding : 1; // has internal undefined bytes - uint16_t fielddesc_type : 2; // 0 -> 8, 1 -> 16, 2 -> 32, 3 -> foreign type - // metadata bit only for GenericMemory eltype layout - uint16_t arrayelem_isboxed : 1; - uint16_t arrayelem_isunion : 1; - // If set, this type's egality can be determined entirely by comparing - // the non-padding bits of this datatype. - uint16_t isbitsegal : 1; - uint16_t padding : 10; - } flags; - // union { - // jl_fielddesc8_t field8[nfields]; - // jl_fielddesc16_t field16[nfields]; - // jl_fielddesc32_t field32[nfields]; - // }; - // union { // offsets relative to data start in words - // uint8_t ptr8[npointers]; - // uint16_t ptr16[npointers]; - // uint32_t ptr32[npointers]; - // }; -} mmtk_jl_datatype_layout_t; - -typedef struct { - void *name; - struct mmtk__jl_module_t *module; - void *names; // field names - const uint32_t *atomicfields; // if any fields are atomic, we record them here - const uint32_t *constfields; // if any fields are const, we record them here - // `wrapper` is either the only instantiation of the type (if no parameters) - // or a UnionAll accepting parameters to make an instantiation. - void *wrapper; - void *Typeofwrapper; - void *cache; // sorted array - void *linearcache; // unsorted array - void *mt; - void *partial; // incomplete instantiations of this type - intptr_t hash; - int32_t n_uninitialized; - // type properties - uint8_t abstract:1; - uint8_t mutabl:1; - uint8_t mayinlinealloc:1; - uint8_t _reserved:5; - uint8_t max_methods; -} mmtk_jl_typename_t; - -typedef struct { - size_t length; - // pointer size aligned - // jl_value_t *data[]; -} mmtk_jl_svec_t; - -typedef struct mmtk__jl_datatype_t { - mmtk_jl_typename_t *name; - struct mmtk__jl_datatype_t *super; - mmtk_jl_svec_t *parameters; - mmtk_jl_svec_t *types; - mmtk_jl_value_t *instance; // for singletons - const mmtk_jl_datatype_layout_t *layout; - // memoized properties - uint32_t hash; - uint16_t hasfreetypevars:1; // majority part of isconcrete computation - uint16_t isconcretetype:1; // whether this type can have instances - uint16_t isdispatchtuple:1; // aka isleaftupletype - uint16_t isbitstype:1; // relevant query for C-api and type-parameters - uint16_t zeroinit:1; // if one or more fields requires zero-initialization - uint16_t has_concrete_subtype:1; // If clear, no value will have this datatype - uint16_t maybe_subtype_of_cache:1; // Computational bit for has_concrete_supertype. See description in jltypes.c. - uint16_t isprimitivetype:1; // whether this is declared with 'primitive type' keyword (sized, no fields, and immutable) - uint16_t ismutationfree:1; // whether any mutable memory is reachable through this type (in the type or via fields) - uint16_t isidentityfree:1; // whether this type or any object reachable through its fields has non-content-based identity - uint16_t smalltag:6; // whether this type has a small-tag optimization -} mmtk_jl_datatype_t; - -typedef struct { - size_t length; - void *ptr; - // followed by padding and inline data, or owner pointer -#ifdef _P64 - // union { - // jl_value_t *owner; - // T inl[]; - // }; -#else - // - // jl_value_t *owner; - // size_t padding[1]; - // T inl[]; -#endif -} mmtk_jl_genericmemory_t; - - -typedef struct { - void *ptr_or_offset; - mmtk_jl_genericmemory_t *mem; -} mmtk_jl_genericmemoryref_t; - -typedef struct { - mmtk_jl_genericmemoryref_t ref; - size_t dimsize[]; // length for 1-D, otherwise length is mem->length -} mmtk_jl_array_t; - - -typedef struct mmtk__jl_sym_t { - _Atomic(void *) left; - _Atomic(void *) right; - uintptr_t hash; // precomputed hash value - // JL_ATTRIBUTE_ALIGN_PTRSIZE(char name[]); -} mmtk_jl_sym_t; - -#ifdef _P64 -// Union of a ptr and a 3 bit field. -typedef uintptr_t mmtk_jl_ptr_kind_union_t; -#else -typedef struct __attribute__((aligned(8))) { void *val; size_t kind; } mmtk_jl_ptr_kind_union_t; -#endif -typedef struct __attribute__((aligned(8))) mmtk__jl_binding_partition_t { - /* union { - * // For ->kind == BINDING_KIND_GLOBAL - * jl_value_t *type_restriction; - * // For ->kind == BINDING_KIND_CONST(_IMPORT) - * jl_value_t *constval; - * // For ->kind in (BINDING_KIND_IMPLICIT, BINDING_KIND_EXPLICIT, BINDING_KIND_IMPORT) - * jl_binding_t *imported; - * } restriction; - * - * Currently: Low 3 bits hold ->kind on _P64 to avoid needing >8 byte atomics - * - * This field is updated atomically with both kind and restriction. The following - * transitions are allowed and modeled by the system: - * - * GUARD -> any - * (DECLARED, FAILED) -> any non-GUARD - * IMPLICIT -> {EXPLICIT, IMPORTED} (->restriction unchanged only) - * - * In addition, we permit (with warning about undefined behavior) changing the restriction - * pointer for CONST(_IMPORT). - * - * All other kind or restriction transitions are disallowed. - */ - _Atomic(mmtk_jl_ptr_kind_union_t) restriction; - size_t min_world; - _Atomic(size_t) max_world; - _Atomic(struct mmtk__jl_binding_partition_t*) next; - size_t reserved; // Reserved for ->kind. Currently this holds the low bits of ->restriction during serialization -} mmtk_jl_binding_partition_t; - -typedef struct { - void *globalref; // cached GlobalRef for this binding - _Atomic(void*) value; - _Atomic(void*) partitions; - uint8_t declared:1; - uint8_t exportp:1; // `public foo` sets `publicp`, `export foo` sets both `publicp` and `exportp` - uint8_t publicp:1; // exportp without publicp is not allowed. - uint8_t deprecated:2; // 0=not deprecated, 1=renamed, 2=moved to another package - uint8_t padding:3; -} mmtk_jl_binding_t; - -#define HT_N_INLINE 32 - -typedef struct { - size_t size; - void **table; - void *_space[HT_N_INLINE]; -} mmtk_htable_t; - -#define AL_N_INLINE 29 - -typedef struct { - size_t len; - size_t max; - void **items; - void *_space[AL_N_INLINE]; -} mmtk_arraylist_t; - -#define SMALL_AL_N_INLINE 6 - -typedef struct { - uint32_t len; - uint32_t max; - void **items; - void *_space[SMALL_AL_N_INLINE]; -} mmtk_small_arraylist_t; - -typedef struct { - uint64_t hi; - uint64_t lo; -} mmtk_jl_uuid_t; - -typedef struct { - _Atomic(void*) owner; - uint32_t count; -} mmtk_jl_mutex_t; - -typedef struct mmtk__jl_module_t { - void *name; - struct mmtk__jl_module_t *parent; - _Atomic(mmtk_jl_svec_t)* bindings; - _Atomic(mmtk_jl_genericmemory_t)* bindingkeyset; // index lookup by name into bindings - void* file; - int32_t line; - // hidden fields: - mmtk_arraylist_t usings; // modules with all bindings potentially imported - mmtk_jl_uuid_t build_id; - mmtk_jl_uuid_t uuid; - _Atomic(uint32_t) counter; - int32_t nospecialize; // global bit flags: initialization for new methods - int8_t optlevel; - int8_t compile; - int8_t infer; - uint8_t istopmod; - int8_t max_methods; - mmtk_jl_mutex_t lock; - intptr_t hash; -} mmtk_jl_module_t; - -// Exception stack: a stack of pairs of (exception,raw_backtrace). -// The stack may be traversed and accessed with the functions below. -struct mmtk__jl_excstack_t { // typedef in julia.h - size_t top; - size_t reserved_size; - // Pack all stack entries into a growable buffer to amortize allocation - // across repeated exception handling. - // Layout: [bt_data1... bt_size1 exc1 bt_data2... bt_size2 exc2 ..] - // jl_bt_element_t data[]; // Access with jl_excstack_raw -}; - -typedef struct mmtk__jl_bt_element_t { - union { - uintptr_t uintptr; // Metadata or native instruction ptr - void* jlvalue; // Pointer to GC-managed value - }; -} mmtk_jl_bt_element_t; - -typedef struct mmtk__jl_excstack_t mmtk_jl_excstack_t; - -#ifdef __USE_POSIX -/* Use the same type for `jmp_buf' and `sigjmp_buf'. - The `__mask_was_saved' flag determines whether - or not `longjmp' will restore the signal mask. */ -// typedef struct __jmp_buf_tag sigjmp_buf[1]; - -/* Store the calling environment in ENV, also saving the - signal mask if SAVEMASK is nonzero. Return 0. */ -# define sigsetjmp(env, savemask) __sigsetjmp (env, savemask) - -/* Jump to the environment saved in ENV, making the - sigsetjmp call there return VAL, or 1 if VAL is 0. - Restore the signal mask if that sigsetjmp call saved it. - This is just an alias `longjmp'. */ -extern void siglongjmp (sigjmp_buf __env, int __val) - __THROWNL __attribute__ ((__noreturn__)); -#endif /* Use POSIX. */ - -# define mmtk_jl_jmp_buf sigjmp_buf - -typedef struct { - mmtk_jl_jmp_buf uc_mcontext; -} mmtk_jl_stack_context_t; - -typedef mmtk_jl_stack_context_t mmtk__jl_ucontext_t; - -typedef struct { - union { - mmtk__jl_ucontext_t *ctx; - mmtk_jl_stack_context_t *copy_ctx; - }; - void *stkbuf; // malloc'd memory (either copybuf or stack) - size_t bufsz; // actual sizeof stkbuf - unsigned int copy_stack:31; // sizeof stack for copybuf - unsigned int started:1; -#if defined(_COMPILER_TSAN_ENABLED_) - void *tsan_state; -#endif -#if defined(_COMPILER_ASAN_ENABLED_) - void *asan_fake_stack; -#endif -} mmtk_jl_ucontext_t; - -typedef struct mmtk__jl_gcframe_t mmtk_jl_gcframe_t; - -struct mmtk__jl_gcframe_t { - size_t nroots; - struct mmtk__jl_gcframe_t *prev; - // actual roots go here -}; - -typedef struct { - mmtk_jl_taggedvalue_t *freelist; // root of list of free objects - mmtk_jl_taggedvalue_t *newpages; // root of list of chunks of free objects - uint16_t osize; // size of objects in this pool -} mmtk_jl_gc_pool_t; - -typedef struct { - _Atomic(int64_t) allocd; - _Atomic(int64_t) pool_live_bytes; - _Atomic(uint64_t) malloc; - _Atomic(uint64_t) realloc; - _Atomic(uint64_t) poolalloc; - _Atomic(uint64_t) bigalloc; - _Atomic(int64_t) free_acc; - _Atomic(uint64_t) alloc_acc; -} mmtk_jl_thread_gc_num_common_t; - -typedef struct { - // variable for tracking weak references - mmtk_small_arraylist_t weak_refs; - // live tasks started on this thread - // that are holding onto a stack from the pool - mmtk_small_arraylist_t live_tasks; - - // variables for tracking malloc'd arrays - struct _mallocmemory_t *mallocarrays; - struct _mallocmemory_t *mafreelist; - -#define JL_N_STACK_POOLS 16 - mmtk_small_arraylist_t free_stacks[JL_N_STACK_POOLS]; -} mmtk_jl_thread_heap_common_t; - -// handle to reference an OS thread -typedef pthread_t mmtk_jl_thread_t; - -typedef struct { - alignas(64) _Atomic(int64_t) top; - alignas(64) _Atomic(int64_t) bottom; - alignas(64) _Atomic(void *) array; -} mmtk_ws_queue_t; - -typedef struct { - mmtk_ws_queue_t chunk_queue; - mmtk_ws_queue_t ptr_queue; - mmtk_arraylist_t reclaim_set; -} mmtk_jl_gc_markqueue_t; - - -typedef struct { - _Atomic(struct mmtk__jl_gc_pagemeta_t *) bottom; -} mmtk_jl_gc_page_stack_t; - - -typedef struct { - // thread local increment of `perm_scanned_bytes` - size_t perm_scanned_bytes; - // thread local increment of `scanned_bytes` - size_t scanned_bytes; - // Number of queued big objects (<= 1024) - size_t nbig_obj; - // Array of queued big objects to be moved between the young list - // and the old list. - // A set low bit means that the object should be moved from the old list - // to the young list (`mark_reset_age`). - // Objects can only be put into this list when the mark bit is flipped to - // `1` (atomically). Combining with the sync after marking, - // this makes sure that a single objects can only appear once in - // the lists (the mark bit cannot be flipped to `0` without sweeping) - void *big_obj[1024]; -} mmtk_jl_gc_mark_cache_t; - -typedef struct { - MMTkMutatorContext mmtk_mutator; - size_t malloc_sz_since_last_poll; -} mmtk_jl_gc_tls_states_t; - -typedef struct { - mmtk_jl_thread_heap_common_t heap; - mmtk_jl_thread_gc_num_common_t gc_num; -} mmtk_jl_gc_tls_states_common_t; - -typedef struct mmtk__jl_tls_states_t { - int16_t tid; - int8_t threadpoolid; - uint64_t rngseed; - _Atomic(volatile size_t *) safepoint; - _Atomic(int8_t) sleep_check_state; // read/write from foreign threads - // Whether it is safe to execute GC at the same time. -#define JL_GC_STATE_UNSAFE 0 - // gc_state = 0 means the thread is running Julia code and is not - // safe to run concurrently to the GC -#define JL_GC_STATE_WAITING 1 - // gc_state = 1 means the thread is doing GC or is waiting for the GC to - // finish. -#define JL_GC_STATE_SAFE 2 - // gc_state = 2 means the thread is running unmanaged code that can be - // execute at the same time with the GC. -#define JL_GC_PARALLEL_COLLECTOR_THREAD 3 - // gc_state = 3 means the thread is a parallel collector thread (i.e. never runs Julia code) -#define JL_GC_CONCURRENT_COLLECTOR_THREAD 4 - // gc_state = 4 means the thread is a concurrent collector thread (background sweeper thread that never runs Julia code) - _Atomic(int8_t) gc_state; // read from foreign threads - // execution of certain certain impure - // statements is prohibited from certain - // callbacks (such as generated functions) - // as it may make compilation undecidable - int16_t in_pure_callback; - int16_t in_finalizer; - int16_t disable_gc; - // Counter to disable finalizer **on the current thread** - int finalizers_inhibited; - mmtk_jl_gc_tls_states_t gc_tls; // this is very large, and the offset of the first member is baked into codegen - mmtk_jl_gc_tls_states_common_t gc_tls_common; // common tls for both GCs - volatile sig_atomic_t defer_signal; - _Atomic(struct mmtk__jl_task_t*) current_task; - struct mmtk__jl_task_t *next_task; - struct mmtk__jl_task_t *previous_task; - struct mmtk__jl_task_t *root_task; - void *timing_stack; - void *stackbase; - size_t stacksize; - // Temp storage for exception thrown in signal handler. Not rooted. - mmtk_jl_value_t *sig_exception; - // Temporary backtrace buffer. Scanned for gc roots when bt_size > 0. - struct mmtk__jl_bt_element_t *bt_data; // JL_MAX_BT_SIZE + 1 elements long - size_t bt_size; // Size for backtrace in transit in bt_data - // Temporary backtrace buffer used only for allocations profiler. - struct mmtk__jl_bt_element_t *profiling_bt_buffer; - // Atomically set by the sender, reset by the handler. - volatile _Atomic(sig_atomic_t) signal_request; // TODO: no actual reason for this to be _Atomic - // Allow the sigint to be raised asynchronously - // this is limited to the few places we do synchronous IO - // we can make this more general (similar to defer_signal) if necessary - volatile sig_atomic_t io_wait; - void *signal_stack; - size_t signal_stack_size; - mmtk_jl_thread_t system_id; - _Atomic(int16_t) suspend_count; - mmtk_arraylist_t finalizers; - // Saved exception for previous *external* API call or NULL if cleared. - // Access via jl_exception_occurred(). - struct _jl_value_t *previous_exception; - - // currently-held locks, to be released when an exception is thrown - mmtk_small_arraylist_t locks; - size_t engine_nqueued; - - // JULIA_DEBUG_SLEEPWAKE( - // uint64_t uv_run_enter; - // uint64_t uv_run_leave; - // uint64_t sleep_enter; - // uint64_t sleep_leave; - // ) - - // some hidden state (usually just because we don't have the type's size declaration) -} mmtk_jl_tls_states_t; - -#define JL_RNG_SIZE 5 // xoshiro 4 + splitmix 1 - -typedef struct mmtk__jl_task_t { - void *next; // invasive linked list for scheduler - void *queue; // invasive linked list for scheduler - void *tls; - void *donenotify; - void *result; - void *scope; - void *start; - uint64_t rngState[JL_RNG_SIZE]; - _Atomic(uint8_t) _state; - uint8_t sticky; // record whether this Task can be migrated to a new thread - _Atomic(uint8_t) _isexception; // set if `result` is an exception to throw or that we exited with - // multiqueue priority - uint16_t priority; - -// hidden state: - // id of owning thread - does not need to be defined until the task runs - _Atomic(int16_t) tid; - // threadpool id - int8_t threadpoolid; - // Reentrancy bits - // Bit 0: 1 if we are currently running inference/codegen - // Bit 1-2: 0-3 counter of how many times we've reentered inference - // Bit 3: 1 if we are writing the image and inference is illegal - uint8_t reentrant_timing; - // saved gc stack top for context switches - mmtk_jl_gcframe_t *gcstack; - size_t world_age; - // quick lookup for current ptls - void* ptls; // == jl_all_tls_states[tid] - // saved exception stack - mmtk_jl_excstack_t *excstack; - // current exception handler - void *eh; - // saved thread state - mmtk_jl_ucontext_t ctx; -} mmtk_jl_task_t; - -typedef struct { - mmtk_jl_value_t *value; -} mmtk_jl_weakref_t; - -// the following mirrors `struct EffectsOverride` in `base/compiler/effects.jl` -typedef union mmtk___jl_purity_overrides_t { - struct { - uint16_t ipo_consistent : 1; - uint16_t ipo_effect_free : 1; - uint16_t ipo_nothrow : 1; - uint16_t ipo_terminates_globally : 1; - // Weaker form of `terminates` that asserts - // that any control flow syntactically in the method - // is guaranteed to terminate, but does not make - // assertions about any called functions. - uint16_t ipo_terminates_locally : 1; - uint16_t ipo_notaskstate : 1; - uint16_t ipo_inaccessiblememonly : 1; - uint16_t ipo_noub : 1; - uint16_t ipo_noub_if_noinbounds : 1; - uint16_t ipo_consistent_overlay : 1; - } overrides; - uint16_t bits; -} mmtk__jl_purity_overrides_t; - -// This type describes a single method definition, and stores data -// shared by the specializations of a function. -typedef struct mmtk__jl_method_t { - void *name; // for error reporting - struct mmtk__jl_module_t *module; - void *file; - int32_t line; - size_t primary_world; - size_t deleted_world; - - // method's type signature. redundant with TypeMapEntry->specTypes - void *sig; - - // table of all jl_method_instance_t specializations we have - _Atomic(void*) specializations; // allocated as [hashable, ..., NULL, linear, ....], or a single item - _Atomic(void*) speckeyset; // index lookup by hash into specializations - - void *slot_syms; // compacted list of slot names (String) - void *external_mt; // reference to the method table this method is part of, null if part of the internal table - void *source; // original code template (jl_code_info_t, but may be compressed), null for builtins - void *debuginfo; // fixed linetable from the source argument, null if not available - _Atomic(void*) unspecialized; // unspecialized executable method instance, or null - void *generator; // executable code-generating function if available - void *roots; // pointers in generated code (shared to reduce memory), or null - // Identify roots by module-of-origin. We only track the module for roots added during incremental compilation. - // May be NULL if no external roots have been added, otherwise it's a Vector{UInt64} - void *root_blocks; // RLE (build_id.lo, offset) pairs (even/odd indexing) - int32_t nroots_sysimg; // # of roots stored in the system image - void *ccallable; // svec(rettype, sig) if a ccallable entry point is requested for this - - // cache of specializations of this method for invoke(), i.e. - // cases where this method was called even though it was not necessarily - // the most specific for the argument types. - _Atomic(void*) invokes; - - // A function that compares two specializations of this method, returning - // `true` if the first signature is to be considered "smaller" than the - // second for purposes of recursion analysis. Set to NULL to use - // the default recursion relation. - void *recursion_relation; - - uint32_t nargs; - uint32_t called; // bit flags: whether each of the first 8 arguments is called - uint32_t nospecialize; // bit flags: which arguments should not be specialized - uint32_t nkw; // # of leading arguments that are actually keyword arguments - // of another method. - // various boolean properties - uint8_t isva; - uint8_t is_for_opaque_closure; - - uint8_t nospecializeinfer; - // uint8 settings - uint8_t constprop; // 0x00 = use heuristic; 0x01 = aggressive; 0x02 = none - uint8_t max_varargs; // 0xFF = use heuristic; otherwise, max # of args to expand - // varargs when specializing. - - // Override the conclusions of inter-procedural effect analysis, - // forcing the conclusion to always true. - mmtk__jl_purity_overrides_t purity; - -// hidden fields: - // lock for modifications to the method - mmtk_jl_mutex_t writelock; -} mmtk_jl_method_t; - -#define JL_SMALL_TYPEOF(XX) \ - /* kinds */ \ - XX(typeofbottom) \ - XX(datatype) \ - XX(unionall) \ - XX(uniontype) \ - /* type parameter objects */ \ - XX(vararg) \ - XX(tvar) \ - XX(symbol) \ - XX(module) \ - /* special GC objects */ \ - XX(simplevector) \ - XX(string) \ - XX(task) \ - /* bits types with special allocators */ \ - XX(bool) \ - XX(char) \ - /*XX(float16)*/ \ - /*XX(float32)*/ \ - /*XX(float64)*/ \ - XX(int16) \ - XX(int32) \ - XX(int64) \ - XX(int8) \ - XX(uint16) \ - XX(uint32) \ - XX(uint64) \ - XX(uint8) \ - /* AST objects */ \ - /* XX(argument) */ \ - /* XX(newvarnode) */ \ - /* XX(slotnumber) */ \ - /* XX(ssavalue) */ \ - /* end of JL_SMALL_TYPEOF */ -enum mmtk_jl_small_typeof_tags { - mmtk_jl_null_tag = 0, -#define XX(name) mmtk_jl_##name##_tag, - JL_SMALL_TYPEOF(XX) -#undef XX - mmtk_jl_tags_count, - mmtk_jl_bitstags_first = mmtk_jl_char_tag, // n.b. bool is not considered a bitstype, since it can be compared by pointer - mmtk_jl_max_tags = 64 -}; - -#ifdef __cplusplus -} -#endif diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 8ec18b5e..598fecb3 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -112,6 +112,26 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.77", +] + [[package]] name = "bitflags" version = "2.6.0" @@ -164,6 +184,15 @@ dependencies = [ "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -184,6 +213,17 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "colorchoice" version = "1.0.2" @@ -340,6 +380,12 @@ dependencies = [ "url", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "heck" version = "0.5.0" @@ -465,6 +511,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets", +] + [[package]] name = "libz-sys" version = "1.1.20" @@ -508,6 +564,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "mmtk" version = "0.27.0" @@ -549,6 +611,7 @@ name = "mmtk-julia" version = "0.1.0" dependencies = [ "atomic 0.4.6", + "bindgen", "built", "cc", "chrono", @@ -572,6 +635,16 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "ntapi" version = "0.4.1" @@ -624,6 +697,16 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +[[package]] +name = "prettyplease" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +dependencies = [ + "proc-macro2", + "syn 2.0.77", +] + [[package]] name = "probe" version = "0.5.1" @@ -721,6 +804,12 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.4.1" diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 867c98e5..2b851d97 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "mmtk-julia" version = "0.1.0" -authors = ["Eduardo Souza "] +authors = ["Eduardo Souza ", "Yi Lin "] +build = "build.rs" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -18,6 +19,7 @@ crate-type = ["cdylib"] [build-dependencies] cc = "*" built = "*" +bindgen = "*" [profile.release] lto = true diff --git a/mmtk/api/mmtk.h b/mmtk/api/mmtk.h index 247b5e4a..ccd3049d 100644 --- a/mmtk/api/mmtk.h +++ b/mmtk/api/mmtk.h @@ -62,41 +62,10 @@ extern const void* MMTK_SIDE_LOG_BIT_BASE_ADDRESS; extern uintptr_t JULIA_MALLOC_BYTES; -/** - * Julia-specific - */ - -// When we call upcalls from Rust, we assume: -// * int is 4 bytes -// * size_t is 8 bytes -typedef struct { - void (* scan_julia_exc_obj) (void* obj, void* closure, ProcessSlotFn process_slot); - void* (* get_stackbase) (int16_t tid); - void (* jl_throw_out_of_memory_error) (void); - uint32_t (*jl_get_gc_disable_counter) (void); - void (* sweep_malloced_memory) (void); - void (* sweep_stack_pools) (void); - void (* wait_in_a_safepoint) (void); - void (* exit_from_safepoint) (int8_t old_state); - uint64_t (* jl_hrtime) (void); - void (* update_gc_stats) (uint64_t, size_t, bool); - uintptr_t (* get_abi_structs_checksum_c) (void); - void* (* get_thread_finalizer_list) (void* tls); - void* (* get_to_finalize_list)(void); - void* (* get_marked_finalizers_list)(void); - void (*arraylist_grow)(void* a, size_t n); - int* (*get_jl_gc_have_pending_finalizers)(void); - void (*scan_vm_specific_roots)(RootsWorkClosure* closure); - void (*update_inlined_array) (void* from, void* to); - void (*prepare_to_collect)(void); - void* (* get_owner_address)(void* m); - size_t (* mmtk_genericmemory_how)(void* m); -} Julia_Upcalls; - /** * Misc */ -extern void mmtk_gc_init(uintptr_t min_heap_size, uintptr_t max_heap_size, uintptr_t n_gcthreads, Julia_Upcalls *calls, uintptr_t header_size, uintptr_t tag); +extern void mmtk_gc_init(uintptr_t min_heap_size, uintptr_t max_heap_size, uintptr_t n_gcthreads, uintptr_t header_size, uintptr_t tag); extern bool mmtk_will_never_move(void* object); extern bool mmtk_process(char* name, char* value); extern void mmtk_scan_region(void); @@ -111,6 +80,11 @@ extern void mmtk_run_finalizers(bool at_exit); extern void mmtk_gc_poll(void *tls); extern void mmtk_julia_copy_stack_check(int copy_stack); extern void* mmtk_get_possibly_forwared(void* object); +extern void mmtk_block_thread_for_gc(void); +extern void* mmtk_new_mutator_iterator(void); +extern void* mmtk_get_next_mutator_tls(void*); +extern void* mmtk_close_mutator_iterator(void*); + /** * VM Accounting diff --git a/mmtk/src/active_plan.rs b/mmtk/src/active_plan.rs index dd704b7c..9c140caa 100644 --- a/mmtk/src/active_plan.rs +++ b/mmtk/src/active_plan.rs @@ -74,13 +74,15 @@ impl ActivePlan for VMActivePlan { // Expose the mutator iterator so they can be used in C. #[no_mangle] -pub extern "C" fn new_mutator_iterator() -> *mut JuliaMutatorIterator<'static> { +pub extern "C" fn mmtk_new_mutator_iterator() -> *mut JuliaMutatorIterator<'static> { let guard = MUTATORS.read().unwrap(); Box::into_raw(Box::new(JuliaMutatorIterator::new(guard))) } #[no_mangle] -pub extern "C" fn get_next_mutator_tls(iter: *mut JuliaMutatorIterator<'static>) -> OpaquePointer { +pub extern "C" fn mmtk_get_next_mutator_tls( + iter: *mut JuliaMutatorIterator<'static>, +) -> OpaquePointer { match unsafe { iter.as_mut() }.unwrap().next() { Some(m) => m.mutator_tls.0 .0, None => OpaquePointer::from_address(Address::ZERO), @@ -88,7 +90,7 @@ pub extern "C" fn get_next_mutator_tls(iter: *mut JuliaMutatorIterator<'static>) } #[no_mangle] -pub extern "C" fn close_mutator_iterator(iter: *mut JuliaMutatorIterator<'static>) { +pub extern "C" fn mmtk_close_mutator_iterator(iter: *mut JuliaMutatorIterator<'static>) { // The boxed pointer will get dropped let _to_drop = unsafe { Box::from_raw(iter) }; } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 9a6477ad..edfb770a 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -1,11 +1,8 @@ // All functions here are extern function. There is no point for marking them as unsafe. #![allow(clippy::not_unsafe_ptr_arg_deref)] - use crate::JuliaVM; -use crate::Julia_Upcalls; use crate::JULIA_HEADER_SIZE; use crate::SINGLETON; -use crate::UPCALLS; use crate::{BUILDER, DISABLED_GC, MUTATORS, USER_TRIGGERED_GC}; use libc::c_char; @@ -26,22 +23,14 @@ pub extern "C" fn mmtk_gc_init( min_heap_size: usize, max_heap_size: usize, n_gcthreads: usize, - calls: *const Julia_Upcalls, header_size: usize, buffer_tag: usize, ) { unsafe { - UPCALLS = calls; crate::JULIA_HEADER_SIZE = header_size; crate::JULIA_BUFF_TAG = buffer_tag; }; - // Assert to make sure our ABI is correct - assert_eq!( - unsafe { ((*UPCALLS).get_abi_structs_checksum_c)() }, - crate::util::get_abi_structs_checksum_rust() - ); - { let mut builder = BUILDER.lock().unwrap(); diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index 1fb6fa5b..fe5de20b 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -1,5 +1,9 @@ +use crate::SINGLETON; +use crate::{ + jl_gc_prepare_to_collect, jl_gc_update_stats, jl_get_gc_disable_counter, jl_hrtime, + jl_throw_out_of_memory_error, +}; use crate::{JuliaVM, USER_TRIGGERED_GC}; -use crate::{SINGLETON, UPCALLS}; use log::{info, trace}; use mmtk::util::alloc::AllocationError; use mmtk::util::opaque_pointer::*; @@ -36,18 +40,18 @@ impl Collection for VMCollection { } // Record the start time of the GC - let now = unsafe { ((*UPCALLS).jl_hrtime)() }; + let now = unsafe { jl_hrtime() }; trace!("gc_start = {}", now); GC_START.store(now, Ordering::Relaxed); } fn resume_mutators(_tls: VMWorkerThread) { // Get the end time of the GC - let end = unsafe { ((*UPCALLS).jl_hrtime)() }; + let end = unsafe { jl_hrtime() }; trace!("gc_end = {}", end); let gc_time = end - GC_START.load(Ordering::Relaxed); unsafe { - ((*UPCALLS).update_gc_stats)( + jl_gc_update_stats( gc_time, crate::api::mmtk_used_bytes(), is_current_gc_nursery(), @@ -72,7 +76,7 @@ impl Collection for VMCollection { fn block_for_gc(_tls: VMMutatorThread) { info!("Triggered GC!"); - unsafe { ((*UPCALLS).prepare_to_collect)() }; + unsafe { jl_gc_prepare_to_collect() }; info!("Finished blocking mutator for GC!"); } @@ -97,7 +101,7 @@ impl Collection for VMCollection { fn out_of_memory(_tls: VMThread, _err_kind: AllocationError) { println!("Out of Memory!"); - unsafe { ((*UPCALLS).jl_throw_out_of_memory_error)() }; + unsafe { jl_throw_out_of_memory_error() }; } fn vm_live_bytes() -> usize { @@ -105,7 +109,7 @@ impl Collection for VMCollection { } fn is_collection_enabled() -> bool { - unsafe { ((*UPCALLS).jl_get_gc_disable_counter)() <= 0 } + unsafe { jl_get_gc_disable_counter() <= 0 } } } diff --git a/mmtk/src/julia_finalizer.rs b/mmtk/src/julia_finalizer.rs index 7d4dec03..16ee0221 100644 --- a/mmtk/src/julia_finalizer.rs +++ b/mmtk/src/julia_finalizer.rs @@ -1,4 +1,3 @@ -use crate::UPCALLS; use mmtk::memory_manager; use mmtk::util::Address; use mmtk::util::ObjectReference; @@ -8,13 +7,18 @@ use mmtk::Mutator; use crate::JuliaVM; +use crate::arraylist_grow; +use crate::jl_gc_get_have_pending_finalizers; +use crate::jl_gc_get_marked_finalizers_list; +use crate::jl_gc_get_thread_finalizer_list; +use crate::jl_gc_get_to_finalize_list; + /// This is a Rust implementation of finalizer scanning in _jl_gc_collect() in gc.c pub fn scan_finalizers_in_rust(tracer: &mut T) { use crate::mmtk::vm::ActivePlan; let to_finalize = ArrayListT::to_finalize_list(); let marked_finalizers_list = ArrayListT::marked_finalizers_list(); - let jl_gc_have_pending_finalizers: *mut i32 = - unsafe { ((*UPCALLS).get_jl_gc_have_pending_finalizers)() }; + let jl_gc_have_pending_finalizers: *mut i32 = unsafe { jl_gc_get_have_pending_finalizers() }; // Current length of marked list: we only need to trace objects after this length if this is a nursery GC. let mut orig_marked_len = marked_finalizers_list.len; @@ -72,17 +76,17 @@ impl ArrayListT { /// ptls->finalizers: new finalizers are registered into this thread local list fn thread_local_finalizer_list(mutator: &Mutator) -> &mut ArrayListT { - let list = unsafe { ((*UPCALLS).get_thread_finalizer_list)(mutator.mutator_tls.0 .0) }; + let list = unsafe { jl_gc_get_thread_finalizer_list(mutator.mutator_tls.0 .0) }; unsafe { &mut *list.to_mut_ptr() } } /// to_finalize: objects that are dead are in this list waiting for finalization fn to_finalize_list<'a>() -> &'a mut ArrayListT { - let list = unsafe { ((*UPCALLS).get_to_finalize_list)() }; + let list = unsafe { jl_gc_get_to_finalize_list() }; unsafe { &mut *list.to_mut_ptr() } } /// finalizer_list_marked: objects that are alive and traced, thus we do not need to scan them again in future nursery GCs. fn marked_finalizers_list<'a>() -> &'a mut ArrayListT { - let list = unsafe { ((*UPCALLS).get_marked_finalizers_list)() }; + let list = unsafe { jl_gc_get_marked_finalizers_list() }; unsafe { &mut *list.to_mut_ptr() } } @@ -103,7 +107,7 @@ impl ArrayListT { if newlen > self.max { // Call into C to grow the list. unsafe { - ((*UPCALLS).arraylist_grow)(Address::from_mut_ptr(self as _), n); + arraylist_grow(Address::from_mut_ptr(self as _), n); } } self.len = newlen diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index d87ac27f..a58cd096 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -3,7 +3,6 @@ use crate::julia_types::*; use crate::slots::JuliaVMSlot; use crate::slots::OffsetSlot; use crate::JULIA_BUFF_TAG; -use crate::UPCALLS; use memoffset::offset_of; use mmtk::util::{Address, ObjectReference}; use mmtk::vm::slot::SimpleSlot; @@ -11,30 +10,35 @@ use mmtk::vm::SlotVisitor; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; +use crate::jl_gc_genericmemory_how; +use crate::jl_gc_get_owner_address_to_mmtk; +use crate::jl_gc_get_stackbase; +use crate::jl_gc_scan_julia_exc_obj; + const JL_MAX_TAGS: usize = 64; // from vm/julia/src/jl_exports.h const OFFSET_OF_INLINED_SPACE_IN_MODULE: usize = - offset_of!(mmtk_jl_module_t, usings) + offset_of!(mmtk_arraylist_t, _space); + offset_of!(jl_module_t, usings) + offset_of!(arraylist_t, _space); #[allow(improper_ctypes)] extern "C" { - pub static jl_simplevector_type: *const mmtk_jl_datatype_t; - pub static jl_genericmemory_typename: *mut mmtk_jl_typename_t; - pub static jl_genericmemoryref_typename: *mut mmtk_jl_typename_t; - pub static jl_array_typename: *mut mmtk_jl_typename_t; - pub static jl_module_type: *const mmtk_jl_datatype_t; - pub static jl_task_type: *const mmtk_jl_datatype_t; - pub static jl_string_type: *const mmtk_jl_datatype_t; - pub static jl_weakref_type: *const mmtk_jl_datatype_t; - pub static jl_symbol_type: *const mmtk_jl_datatype_t; - pub static jl_method_type: *const mmtk_jl_datatype_t; - pub static jl_binding_partition_type: *const mmtk_jl_datatype_t; - pub static mut jl_small_typeof: [*mut mmtk_jl_datatype_t; 128usize]; + pub static jl_simplevector_type: *const jl_datatype_t; + pub static jl_genericmemory_typename: *mut jl_typename_t; + pub static jl_genericmemoryref_typename: *mut jl_typename_t; + pub static jl_array_typename: *mut jl_typename_t; + pub static jl_module_type: *const jl_datatype_t; + pub static jl_task_type: *const jl_datatype_t; + pub static jl_string_type: *const jl_datatype_t; + pub static jl_weakref_type: *const jl_datatype_t; + pub static jl_symbol_type: *const jl_datatype_t; + pub static jl_method_type: *const jl_datatype_t; + pub static jl_binding_partition_type: *const jl_datatype_t; + pub static mut jl_small_typeof: [*mut jl_datatype_t; 128usize]; } #[inline(always)] pub unsafe fn mmtk_jl_typetagof(addr: Address) -> Address { let as_tagged_value = - addr.as_usize() - std::mem::size_of::(); + addr.as_usize() - std::mem::size_of::(); let t_header = Address::from_usize(as_tagged_value).load::
(); let t = t_header.as_usize() & !0xf; @@ -42,18 +46,18 @@ pub unsafe fn mmtk_jl_typetagof(addr: Address) -> Address { } #[inline(always)] -pub unsafe fn mmtk_jl_typeof(addr: Address) -> *const mmtk_jl_datatype_t { +pub unsafe fn mmtk_jl_typeof(addr: Address) -> *const jl_datatype_t { mmtk_jl_to_typeof(mmtk_jl_typetagof(addr)) } #[inline(always)] -pub unsafe fn mmtk_jl_to_typeof(t: Address) -> *const mmtk_jl_datatype_t { +pub unsafe fn mmtk_jl_to_typeof(t: Address) -> *const jl_datatype_t { let t_raw = t.as_usize(); if t_raw < (JL_MAX_TAGS << 4) { let ty = jl_small_typeof[t_raw / std::mem::size_of::
()]; return ty; } - return t.to_ptr::(); + return t.to_ptr::(); } const PRINT_OBJ_TYPE: bool = false; @@ -76,23 +80,23 @@ pub unsafe fn scan_julia_object>(obj: Address, clos // symbols are always marked // buffers are marked by their parent object - if vtag.to_ptr::() == jl_symbol_type || vtag_usize == JULIA_BUFF_TAG { + if vtag.to_ptr::() == jl_symbol_type || vtag_usize == JULIA_BUFF_TAG { return; } - if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_unionall_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_uniontype_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_tvar_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_vararg_tag as usize) << 4) + if vtag_usize == ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_unionall_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_uniontype_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_tvar_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_vararg_tag as usize) << 4) { // these objects have pointers in them, but no other special handling // so we want these to fall through to the end vtag_usize = jl_small_typeof[vtag.as_usize() / std::mem::size_of::
()] as usize; vtag = Address::from_usize(vtag_usize); - } else if vtag_usize < ((mmtk_jl_small_typeof_tags_mmtk_jl_max_tags as usize) << 4) { + } else if vtag_usize < ((jl_small_typeof_tags_jl_max_tags as usize) << 4) { // these objects either have specialing handling - if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_simplevector_tag as usize) << 4) { + if vtag_usize == ((jl_small_typeof_tags_jl_simplevector_tag as usize) << 4) { if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: simple vector\n", obj); } @@ -104,12 +108,12 @@ pub unsafe fn scan_julia_object>(obj: Address, clos process_slot(closure, objary_begin); objary_begin = objary_begin.shift::
(1); } - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_module_tag as usize) << 4) { + } else if vtag_usize == ((jl_small_typeof_tags_jl_module_tag as usize) << 4) { if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: module\n", obj); } - let m = obj.to_ptr::(); + let m = obj.to_ptr::(); let bindings_slot = ::std::ptr::addr_of!((*m).bindings); if PRINT_OBJ_TYPE { println!(" - scan bindings: {:?}\n", bindings_slot); @@ -151,12 +155,12 @@ pub unsafe fn scan_julia_object>(obj: Address, clos objary_begin = objary_begin.shift::
(1); } } - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_task_tag as usize) << 4) { + } else if vtag_usize == ((jl_small_typeof_tags_jl_task_tag as usize) << 4) { if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: task\n", obj); } - let ta = obj.to_ptr::(); + let ta = obj.to_ptr::(); mmtk_scan_gcstack(ta, closure); @@ -173,30 +177,30 @@ pub unsafe fn scan_julia_object>(obj: Address, clos process_slot(closure, slot); obj8_begin = obj8_begin.shift::(1); } - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_string_tag as usize) << 4) { + } else if vtag_usize == ((jl_small_typeof_tags_jl_string_tag as usize) << 4) { if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: string\n", obj); } } return; } else { - let vt = vtag.to_ptr::(); + let vt = vtag.to_ptr::(); let type_tag = mmtk_jl_typetagof(vtag); - if type_tag.as_usize() != ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4) + if type_tag.as_usize() != ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4) || (*vt).smalltag() != 0 { panic!( "GC error (probable corruption) - !jl_is_datatype(vt) = {}; vt->smalltag = {}, vt = {:?}", - vt as usize != ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4), - (*(vtag.to_ptr::())).smalltag() != 0, + vt as usize != ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4), + (*(vtag.to_ptr::())).smalltag() != 0, vt ); } } - let vt = vtag.to_ptr::(); + let vt = vtag.to_ptr::(); if (*vt).name == jl_array_typename { - let a = obj.to_ptr::(); + let a = obj.to_ptr::(); let memref = (*a).ref_; let ptr_or_offset = memref.ptr_or_offset; @@ -219,8 +223,8 @@ pub unsafe fn scan_julia_object>(obj: Address, clos if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: genericmemory\n", obj); } - let m = obj.to_ptr::(); - let how = mmtk_jl_genericmemory_how(m); + let m = obj.to_ptr::(); + let how = jl_gc_genericmemory_how(obj); if PRINT_OBJ_TYPE { println!("scan_julia_obj {}: genericmemory how = {}\n", obj, how); @@ -310,11 +314,11 @@ pub unsafe fn scan_julia_object>(obj: Address, clos return; } else { if vt == jl_binding_partition_type { - let bpart_ptr = obj.to_mut_ptr::(); - let restriction = (*bpart_ptr).restriction; + let bpart_ptr = obj.to_mut_ptr::(); + let restriction = (*bpart_ptr).restriction._M_i; let offset = mmtk_decode_restriction_value(restriction); let slot = Address::from_ptr(::std::ptr::addr_of!((*bpart_ptr).restriction)); - if restriction as usize - offset != 0 { + if restriction - offset != 0 { process_offset_slot(closure, slot, offset); } } @@ -359,23 +363,9 @@ pub unsafe fn scan_julia_object>(obj: Address, clos } } -/* - how - allocation style - 0 = data is inlined - 1 = owns the gc-managed data, exclusively (will free it) - 2 = malloc-allocated pointer (does not own it) - 3 = has a pointer to the object that owns the data pointer -*/ -#[inline(always)] -pub unsafe fn mmtk_jl_genericmemory_how(m: *const mmtk_jl_genericmemory_t) -> usize { - return unsafe { ((*UPCALLS).mmtk_genericmemory_how)(Address::from_ptr(m)) }; -} - #[inline(always)] -unsafe fn mmtk_jl_genericmemory_data_owner_field_address( - m: *const mmtk_jl_genericmemory_t, -) -> Address { - unsafe { ((*UPCALLS).get_owner_address)(Address::from_ptr(m)) } +unsafe fn mmtk_jl_genericmemory_data_owner_field_address(m: *const jl_genericmemory_t) -> Address { + unsafe { jl_gc_get_owner_address_to_mmtk(Address::from_ptr(m)) } } // #[inline(always)] @@ -386,7 +376,7 @@ unsafe fn mmtk_jl_genericmemory_data_owner_field_address( // } pub unsafe fn mmtk_scan_gcstack>( - ta: *const mmtk_jl_task_t, + ta: *const jl_task_t, closure: &mut EV, ) { let stkbuf = (*ta).ctx.stkbuf; @@ -403,10 +393,10 @@ pub unsafe fn mmtk_scan_gcstack>( #[cfg(feature = "julia_copy_stack")] if stkbuf != std::ptr::null_mut() && copy_stack != 0 && (*ta).ptls == std::ptr::null_mut() { - if ((*ta).tid as i16) < 0 { + if ((*ta).tid._M_i) < 0 { panic!("tid must be positive.") } - let stackbase = ((*UPCALLS).get_stackbase)((*ta).tid); + let stackbase = jl_gc_get_stackbase((*ta).tid._M_i); ub = stackbase as u64; lb = ub - ((*ta).ctx.copy_stack() as u64); offset = (*ta).ctx.stkbuf as isize - lb as isize; @@ -415,7 +405,7 @@ pub unsafe fn mmtk_scan_gcstack>( if s != std::ptr::null_mut() { let s_nroots_addr = ::std::ptr::addr_of!((*s).nroots); let mut nroots = read_stack(Address::from_ptr(s_nroots_addr), offset, lb, ub); - debug_assert!(nroots.as_usize() as u32 <= UINT32_MAX); + debug_assert!(nroots.as_usize() as u32 <= std::u32::MAX); let mut nr = nroots >> 2; loop { @@ -458,7 +448,7 @@ pub unsafe fn mmtk_scan_gcstack>( break; } - s = sprev.to_mut_ptr::(); + s = sprev.to_mut_ptr::(); let s_nroots_addr = ::std::ptr::addr_of!((*s).nroots); let new_nroots = read_stack(Address::from_ptr(s_nroots_addr), offset, lb, ub); nroots = new_nroots; @@ -469,7 +459,7 @@ pub unsafe fn mmtk_scan_gcstack>( // just call into C, since the code is cold if (*ta).excstack != std::ptr::null_mut() { - ((*UPCALLS).scan_julia_exc_obj)( + jl_gc_scan_julia_exc_obj( Address::from_ptr(ta), Address::from_mut_ptr(closure), process_slot:: as _, @@ -536,13 +526,13 @@ pub fn process_slot>(closure: &mut EV, slot: Addres // However, since MMTk uses the slot to load the object, we get the offset from pku using // that offset to pass to process_offset_edge and get the right address. #[inline(always)] -pub fn mmtk_decode_restriction_value(pku: u64) -> usize { +pub fn mmtk_decode_restriction_value(pku: usize) -> usize { #[cfg(target_pointer_width = "64")] { // need to apply (pku & ~0x7) to get the object to be traced // so we use (pku & 0x7) to get the offset from the object // and pass it to process_offset_slot - return pku as usize & 0x7; + return pku & 0x7; } #[cfg(not(target_pointer_width = "64"))] @@ -588,42 +578,42 @@ pub fn mmtk_jl_array_ndimwords(ndims: u32) -> usize { #[inline(always)] pub unsafe fn mmtk_jl_svec_len(obj: Address) -> usize { - (*obj.to_ptr::()).length + (*obj.to_ptr::()).length } #[inline(always)] pub unsafe fn mmtk_jl_svec_data(obj: Address) -> Address { - obj + std::mem::size_of::() + obj + std::mem::size_of::() } #[inline(always)] -pub unsafe fn mmtk_jl_tparam0(vt: *const mmtk_jl_datatype_t) -> *const mmtk_jl_datatype_t { +pub unsafe fn mmtk_jl_tparam0(vt: *const jl_datatype_t) -> *const jl_datatype_t { mmtk_jl_svecref((*vt).parameters, 0) } #[inline(always)] -pub unsafe fn mmtk_jl_svecref(vt: *mut mmtk_jl_svec_t, i: usize) -> *const mmtk_jl_datatype_t { +pub unsafe fn mmtk_jl_svecref(vt: *mut jl_svec_t, i: usize) -> *const jl_datatype_t { debug_assert!( mmtk_jl_typetagof(Address::from_mut_ptr(vt)).as_usize() - == (mmtk_jl_small_typeof_tags_mmtk_jl_simplevector_tag << 4) as usize + == (jl_small_typeof_tags_jl_simplevector_tag << 4) as usize ); debug_assert!(i < mmtk_jl_svec_len(Address::from_mut_ptr(vt))); let svec_data = mmtk_jl_svec_data(Address::from_mut_ptr(vt)); let result_ptr = svec_data + i; let result = result_ptr.atomic_load::(Ordering::Relaxed); - ::std::mem::transmute::(result) + ::std::mem::transmute::(result) } #[inline(always)] -pub unsafe fn mmtk_jl_dt_layout_ptrs(l: *const mmtk_jl_datatype_layout_t) -> Address { +pub unsafe fn mmtk_jl_dt_layout_ptrs(l: *const jl_datatype_layout_t) -> Address { mmtk_jl_dt_layout_fields(l) + (mmtk_jl_fielddesc_size((*l).fielddesc_type_custom()) * (*l).nfields) as usize } #[inline(always)] -pub unsafe fn mmtk_jl_dt_layout_fields(l: *const mmtk_jl_datatype_layout_t) -> Address { - Address::from_ptr(l) + std::mem::size_of::() +pub unsafe fn mmtk_jl_dt_layout_fields(l: *const jl_datatype_layout_t) -> Address { + Address::from_ptr(l) + std::mem::size_of::() } #[inline(always)] @@ -634,12 +624,12 @@ pub unsafe fn mmtk_jl_fielddesc_size(fielddesc_type: u16) -> u32 { const JL_BT_NON_PTR_ENTRY: usize = usize::MAX; -pub fn mmtk_jl_bt_is_native(bt_entry: *mut mmtk_jl_bt_element_t) -> bool { +pub fn mmtk_jl_bt_is_native(bt_entry: *mut jl_bt_element_t) -> bool { let entry = unsafe { (*bt_entry).__bindgen_anon_1.uintptr }; entry != JL_BT_NON_PTR_ENTRY } -pub fn mmtk_jl_bt_entry_size(bt_entry: *mut mmtk_jl_bt_element_t) -> usize { +pub fn mmtk_jl_bt_entry_size(bt_entry: *mut jl_bt_element_t) -> usize { if mmtk_jl_bt_is_native(bt_entry) { 1 } else { @@ -647,19 +637,19 @@ pub fn mmtk_jl_bt_entry_size(bt_entry: *mut mmtk_jl_bt_element_t) -> usize { } } -pub fn mmtk_jl_bt_num_jlvals(bt_entry: *mut mmtk_jl_bt_element_t) -> usize { +pub fn mmtk_jl_bt_num_jlvals(bt_entry: *mut jl_bt_element_t) -> usize { debug_assert!(!mmtk_jl_bt_is_native(bt_entry)); let entry = unsafe { (*bt_entry.add(1)).__bindgen_anon_1.uintptr }; entry & 0x7 } -pub fn mmtk_jl_bt_num_uintvals(bt_entry: *mut mmtk_jl_bt_element_t) -> usize { +pub fn mmtk_jl_bt_num_uintvals(bt_entry: *mut jl_bt_element_t) -> usize { debug_assert!(!mmtk_jl_bt_is_native(bt_entry)); let entry = unsafe { (*bt_entry.add(1)).__bindgen_anon_1.uintptr }; (entry >> 3) & 0x7 } -pub fn mmtk_jl_bt_entry_jlvalue(bt_entry: *mut mmtk_jl_bt_element_t, i: usize) -> ObjectReference { +pub fn mmtk_jl_bt_entry_jlvalue(bt_entry: *mut jl_bt_element_t, i: usize) -> ObjectReference { let entry = unsafe { (*bt_entry.add(2 + i)).__bindgen_anon_1.jlvalue }; debug_assert!(!entry.is_null()); unsafe { ObjectReference::from_raw_address_unchecked(Address::from_mut_ptr(entry)) } diff --git a/mmtk/src/julia_types.rs b/mmtk/src/julia_types.rs index e38d1831..e5b5e00e 100644 --- a/mmtk/src/julia_types.rs +++ b/mmtk/src/julia_types.rs @@ -110,307 +110,15 @@ impl ::std::fmt::Debug for __IncompleteArrayField { fmt.write_str("__IncompleteArrayField") } } -pub const _SETJMP_H: u32 = 1; -pub const _FEATURES_H: u32 = 1; -pub const _ISOC95_SOURCE: u32 = 1; -pub const _ISOC99_SOURCE: u32 = 1; -pub const _ISOC11_SOURCE: u32 = 1; -pub const _ISOC2X_SOURCE: u32 = 1; -pub const _POSIX_SOURCE: u32 = 1; -pub const _POSIX_C_SOURCE: u32 = 200809; -pub const _XOPEN_SOURCE: u32 = 700; -pub const _XOPEN_SOURCE_EXTENDED: u32 = 1; -pub const _LARGEFILE64_SOURCE: u32 = 1; -pub const _DEFAULT_SOURCE: u32 = 1; -pub const _ATFILE_SOURCE: u32 = 1; -pub const _DYNAMIC_STACK_SIZE_SOURCE: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 1; -pub const __USE_ISOC11: u32 = 1; -pub const __USE_ISOC99: u32 = 1; -pub const __USE_ISOC95: u32 = 1; -pub const __USE_ISOCXX11: u32 = 1; -pub const __USE_POSIX: u32 = 1; -pub const __USE_POSIX2: u32 = 1; -pub const __USE_POSIX199309: u32 = 1; -pub const __USE_POSIX199506: u32 = 1; -pub const __USE_XOPEN2K: u32 = 1; -pub const __USE_XOPEN2K8: u32 = 1; -pub const __USE_XOPEN: u32 = 1; -pub const __USE_XOPEN_EXTENDED: u32 = 1; -pub const __USE_UNIX98: u32 = 1; -pub const _LARGEFILE_SOURCE: u32 = 1; -pub const __USE_XOPEN2K8XSI: u32 = 1; -pub const __USE_XOPEN2KXSI: u32 = 1; -pub const __USE_LARGEFILE: u32 = 1; -pub const __USE_LARGEFILE64: u32 = 1; -pub const __WORDSIZE: u32 = 64; -pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; -pub const __SYSCALL_WORDSIZE: u32 = 64; -pub const __TIMESIZE: u32 = 64; -pub const __USE_MISC: u32 = 1; -pub const __USE_ATFILE: u32 = 1; -pub const __USE_DYNAMIC_STACK_SIZE: u32 = 1; -pub const __USE_GNU: u32 = 1; -pub const __USE_FORTIFY_LEVEL: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; -pub const _STDC_PREDEF_H: u32 = 1; -pub const __STDC_IEC_559__: u32 = 1; -pub const __STDC_IEC_60559_BFP__: u32 = 201404; -pub const __STDC_IEC_559_COMPLEX__: u32 = 1; -pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404; -pub const __STDC_ISO_10646__: u32 = 201706; -pub const __GNU_LIBRARY__: u32 = 6; -pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 35; -pub const _SYS_CDEFS_H: u32 = 1; -pub const __glibc_c99_flexarr_available: u32 = 1; -pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; -pub const __HAVE_GENERIC_SELECTION: u32 = 0; -pub const _BITS_SETJMP_H: u32 = 1; -pub const __jmp_buf_tag_defined: u32 = 1; -pub const _STDINT_H: u32 = 1; -pub const __GLIBC_USE_LIB_EXT2: u32 = 1; -pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 1; -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 1; -pub const __GLIBC_USE_IEC_60559_EXT: u32 = 1; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 1; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 1; -pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 1; -pub const _BITS_TYPES_H: u32 = 1; -pub const _BITS_TYPESIZES_H: u32 = 1; -pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; -pub const __INO_T_MATCHES_INO64_T: u32 = 1; -pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; -pub const __STATFS_MATCHES_STATFS64: u32 = 1; -pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1; -pub const __FD_SETSIZE: u32 = 1024; -pub const _BITS_TIME64_H: u32 = 1; -pub const _BITS_WCHAR_H: u32 = 1; -pub const _BITS_STDINT_INTN_H: u32 = 1; -pub const _BITS_STDINT_UINTN_H: u32 = 1; -pub const INT8_MIN: i32 = -128; -pub const INT16_MIN: i32 = -32768; -pub const INT32_MIN: i32 = -2147483648; -pub const INT8_MAX: u32 = 127; -pub const INT16_MAX: u32 = 32767; -pub const INT32_MAX: u32 = 2147483647; -pub const UINT8_MAX: u32 = 255; -pub const UINT16_MAX: u32 = 65535; -pub const UINT32_MAX: u32 = 4294967295; -pub const INT_LEAST8_MIN: i32 = -128; -pub const INT_LEAST16_MIN: i32 = -32768; -pub const INT_LEAST32_MIN: i32 = -2147483648; -pub const INT_LEAST8_MAX: u32 = 127; -pub const INT_LEAST16_MAX: u32 = 32767; -pub const INT_LEAST32_MAX: u32 = 2147483647; -pub const UINT_LEAST8_MAX: u32 = 255; -pub const UINT_LEAST16_MAX: u32 = 65535; -pub const UINT_LEAST32_MAX: u32 = 4294967295; -pub const INT_FAST8_MIN: i32 = -128; -pub const INT_FAST16_MIN: i64 = -9223372036854775808; -pub const INT_FAST32_MIN: i64 = -9223372036854775808; -pub const INT_FAST8_MAX: u32 = 127; -pub const INT_FAST16_MAX: u64 = 9223372036854775807; -pub const INT_FAST32_MAX: u64 = 9223372036854775807; -pub const UINT_FAST8_MAX: u32 = 255; -pub const UINT_FAST16_MAX: i32 = -1; -pub const UINT_FAST32_MAX: i32 = -1; -pub const INTPTR_MIN: i64 = -9223372036854775808; -pub const INTPTR_MAX: u64 = 9223372036854775807; -pub const UINTPTR_MAX: i32 = -1; -pub const PTRDIFF_MIN: i64 = -9223372036854775808; -pub const PTRDIFF_MAX: u64 = 9223372036854775807; -pub const SIG_ATOMIC_MIN: i32 = -2147483648; -pub const SIG_ATOMIC_MAX: u32 = 2147483647; -pub const SIZE_MAX: i32 = -1; -pub const WINT_MIN: u32 = 0; -pub const WINT_MAX: u32 = 4294967295; -pub const INT8_WIDTH: u32 = 8; -pub const UINT8_WIDTH: u32 = 8; -pub const INT16_WIDTH: u32 = 16; -pub const UINT16_WIDTH: u32 = 16; -pub const INT32_WIDTH: u32 = 32; -pub const UINT32_WIDTH: u32 = 32; -pub const INT64_WIDTH: u32 = 64; -pub const UINT64_WIDTH: u32 = 64; -pub const INT_LEAST8_WIDTH: u32 = 8; -pub const UINT_LEAST8_WIDTH: u32 = 8; -pub const INT_LEAST16_WIDTH: u32 = 16; -pub const UINT_LEAST16_WIDTH: u32 = 16; -pub const INT_LEAST32_WIDTH: u32 = 32; -pub const UINT_LEAST32_WIDTH: u32 = 32; -pub const INT_LEAST64_WIDTH: u32 = 64; -pub const UINT_LEAST64_WIDTH: u32 = 64; -pub const INT_FAST8_WIDTH: u32 = 8; -pub const UINT_FAST8_WIDTH: u32 = 8; -pub const INT_FAST16_WIDTH: u32 = 64; -pub const UINT_FAST16_WIDTH: u32 = 64; -pub const INT_FAST32_WIDTH: u32 = 64; -pub const UINT_FAST32_WIDTH: u32 = 64; -pub const INT_FAST64_WIDTH: u32 = 64; -pub const UINT_FAST64_WIDTH: u32 = 64; -pub const INTPTR_WIDTH: u32 = 64; -pub const UINTPTR_WIDTH: u32 = 64; -pub const INTMAX_WIDTH: u32 = 64; -pub const UINTMAX_WIDTH: u32 = 64; -pub const PTRDIFF_WIDTH: u32 = 64; -pub const SIG_ATOMIC_WIDTH: u32 = 32; -pub const SIZE_WIDTH: u32 = 64; -pub const WCHAR_WIDTH: u32 = 32; -pub const WINT_WIDTH: u32 = 32; -pub const _PTHREAD_H: u32 = 1; -pub const _SCHED_H: u32 = 1; -pub const __time_t_defined: u32 = 1; -pub const _STRUCT_TIMESPEC: u32 = 1; -pub const _BITS_ENDIAN_H: u32 = 1; -pub const __LITTLE_ENDIAN: u32 = 1234; -pub const __BIG_ENDIAN: u32 = 4321; -pub const __PDP_ENDIAN: u32 = 3412; -pub const _BITS_ENDIANNESS_H: u32 = 1; -pub const __BYTE_ORDER: u32 = 1234; -pub const __FLOAT_WORD_ORDER: u32 = 1234; -pub const _BITS_SCHED_H: u32 = 1; -pub const SCHED_OTHER: u32 = 0; -pub const SCHED_FIFO: u32 = 1; -pub const SCHED_RR: u32 = 2; -pub const SCHED_BATCH: u32 = 3; -pub const SCHED_ISO: u32 = 4; -pub const SCHED_IDLE: u32 = 5; -pub const SCHED_DEADLINE: u32 = 6; -pub const SCHED_RESET_ON_FORK: u32 = 1073741824; -pub const CSIGNAL: u32 = 255; -pub const CLONE_VM: u32 = 256; -pub const CLONE_FS: u32 = 512; -pub const CLONE_FILES: u32 = 1024; -pub const CLONE_SIGHAND: u32 = 2048; -pub const CLONE_PIDFD: u32 = 4096; -pub const CLONE_PTRACE: u32 = 8192; -pub const CLONE_VFORK: u32 = 16384; -pub const CLONE_PARENT: u32 = 32768; -pub const CLONE_THREAD: u32 = 65536; -pub const CLONE_NEWNS: u32 = 131072; -pub const CLONE_SYSVSEM: u32 = 262144; -pub const CLONE_SETTLS: u32 = 524288; -pub const CLONE_PARENT_SETTID: u32 = 1048576; -pub const CLONE_CHILD_CLEARTID: u32 = 2097152; -pub const CLONE_DETACHED: u32 = 4194304; -pub const CLONE_UNTRACED: u32 = 8388608; -pub const CLONE_CHILD_SETTID: u32 = 16777216; -pub const CLONE_NEWCGROUP: u32 = 33554432; -pub const CLONE_NEWUTS: u32 = 67108864; -pub const CLONE_NEWIPC: u32 = 134217728; -pub const CLONE_NEWUSER: u32 = 268435456; -pub const CLONE_NEWPID: u32 = 536870912; -pub const CLONE_NEWNET: u32 = 1073741824; -pub const CLONE_IO: u32 = 2147483648; -pub const _BITS_TYPES_STRUCT_SCHED_PARAM: u32 = 1; -pub const _BITS_CPU_SET_H: u32 = 1; -pub const __CPU_SETSIZE: u32 = 1024; -pub const CPU_SETSIZE: u32 = 1024; -pub const _TIME_H: u32 = 1; -pub const _BITS_TIME_H: u32 = 1; -pub const CLOCK_REALTIME: u32 = 0; -pub const CLOCK_MONOTONIC: u32 = 1; -pub const CLOCK_PROCESS_CPUTIME_ID: u32 = 2; -pub const CLOCK_THREAD_CPUTIME_ID: u32 = 3; -pub const CLOCK_MONOTONIC_RAW: u32 = 4; -pub const CLOCK_REALTIME_COARSE: u32 = 5; -pub const CLOCK_MONOTONIC_COARSE: u32 = 6; -pub const CLOCK_BOOTTIME: u32 = 7; -pub const CLOCK_REALTIME_ALARM: u32 = 8; -pub const CLOCK_BOOTTIME_ALARM: u32 = 9; -pub const CLOCK_TAI: u32 = 11; -pub const TIMER_ABSTIME: u32 = 1; -pub const _BITS_TIMEX_H: u32 = 1; -pub const __timeval_defined: u32 = 1; -pub const ADJ_OFFSET: u32 = 1; -pub const ADJ_FREQUENCY: u32 = 2; -pub const ADJ_MAXERROR: u32 = 4; -pub const ADJ_ESTERROR: u32 = 8; -pub const ADJ_STATUS: u32 = 16; -pub const ADJ_TIMECONST: u32 = 32; -pub const ADJ_TAI: u32 = 128; -pub const ADJ_SETOFFSET: u32 = 256; -pub const ADJ_MICRO: u32 = 4096; -pub const ADJ_NANO: u32 = 8192; -pub const ADJ_TICK: u32 = 16384; -pub const ADJ_OFFSET_SINGLESHOT: u32 = 32769; -pub const ADJ_OFFSET_SS_READ: u32 = 40961; -pub const MOD_OFFSET: u32 = 1; -pub const MOD_FREQUENCY: u32 = 2; -pub const MOD_MAXERROR: u32 = 4; -pub const MOD_ESTERROR: u32 = 8; -pub const MOD_STATUS: u32 = 16; -pub const MOD_TIMECONST: u32 = 32; -pub const MOD_CLKB: u32 = 16384; -pub const MOD_CLKA: u32 = 32769; -pub const MOD_TAI: u32 = 128; -pub const MOD_MICRO: u32 = 4096; -pub const MOD_NANO: u32 = 8192; -pub const STA_PLL: u32 = 1; -pub const STA_PPSFREQ: u32 = 2; -pub const STA_PPSTIME: u32 = 4; -pub const STA_FLL: u32 = 8; -pub const STA_INS: u32 = 16; -pub const STA_DEL: u32 = 32; -pub const STA_UNSYNC: u32 = 64; -pub const STA_FREQHOLD: u32 = 128; -pub const STA_PPSSIGNAL: u32 = 256; -pub const STA_PPSJITTER: u32 = 512; -pub const STA_PPSWANDER: u32 = 1024; -pub const STA_PPSERROR: u32 = 2048; -pub const STA_CLOCKERR: u32 = 4096; -pub const STA_NANO: u32 = 8192; -pub const STA_MODE: u32 = 16384; -pub const STA_CLK: u32 = 32768; -pub const STA_RONLY: u32 = 65280; -pub const __clock_t_defined: u32 = 1; -pub const __struct_tm_defined: u32 = 1; -pub const __clockid_t_defined: u32 = 1; -pub const __timer_t_defined: u32 = 1; -pub const __itimerspec_defined: u32 = 1; -pub const _BITS_TYPES_LOCALE_T_H: u32 = 1; -pub const _BITS_TYPES___LOCALE_T_H: u32 = 1; -pub const TIME_UTC: u32 = 1; -pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; -pub const _THREAD_SHARED_TYPES_H: u32 = 1; -pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; -pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; -pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; -pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; -pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; -pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; -pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; -pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; -pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1; -pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; -pub const __have_pthread_attr_t: u32 = 1; -pub const __SC_THREAD_STACK_MIN_VALUE: u32 = 75; -pub const PTHREAD_ONCE_INIT: u32 = 0; -pub const PTHREAD_BARRIER_SERIAL_THREAD: i32 = -1; -pub const PTHREAD_ATTR_NO_SIGMASK_NP: i32 = -1; -pub const MAX_BUMP_ALLOCATORS: u32 = 6; -pub const MAX_LARGE_OBJECT_ALLOCATORS: u32 = 2; -pub const MAX_MALLOC_ALLOCATORS: u32 = 1; -pub const MAX_IMMIX_ALLOCATORS: u32 = 1; -pub const MAX_FREE_LIST_ALLOCATORS: u32 = 2; -pub const MAX_MARK_COMPACT_ALLOCATORS: u32 = 1; -pub const __alignas_is_defined: u32 = 1; -pub const __alignof_is_defined: u32 = 1; -pub const HT_N_INLINE: u32 = 32; -pub const AL_N_INLINE: u32 = 29; -pub const SMALL_AL_N_INLINE: u32 = 6; -pub const JL_N_STACK_POOLS: u32 = 16; -pub const JL_GC_STATE_UNSAFE: u32 = 0; -pub const JL_GC_STATE_WAITING: u32 = 1; -pub const JL_GC_STATE_SAFE: u32 = 2; -pub const JL_GC_PARALLEL_COLLECTOR_THREAD: u32 = 3; -pub const JL_GC_CONCURRENT_COLLECTOR_THREAD: u32 = 4; -pub const JL_RNG_SIZE: u32 = 5; -pub type __jmp_buf = [::std::os::raw::c_long; 8usize]; +#[repr(C)] +#[derive(Debug)] +pub struct std_atomic<_Tp> { + pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Tp>>, + pub _M_i: _Tp, +} +pub type std_atomic_value_type<_Tp> = _Tp; +pub type __sig_atomic_t = ::std::os::raw::c_int; +pub type jl_gcframe_t = _jl_gcframe_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sigset_t { @@ -422,6 +130,46 @@ const _: () = { ["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]; }; +pub type pthread_t = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct arraylist_t { + pub len: usize, + pub max: usize, + pub items: *mut *mut ::std::os::raw::c_void, + pub _space: [*mut ::std::os::raw::c_void; 29usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of arraylist_t"][::std::mem::size_of::() - 256usize]; + ["Alignment of arraylist_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: arraylist_t::len"][::std::mem::offset_of!(arraylist_t, len) - 0usize]; + ["Offset of field: arraylist_t::max"][::std::mem::offset_of!(arraylist_t, max) - 8usize]; + ["Offset of field: arraylist_t::items"][::std::mem::offset_of!(arraylist_t, items) - 16usize]; + ["Offset of field: arraylist_t::_space"][::std::mem::offset_of!(arraylist_t, _space) - 24usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct small_arraylist_t { + pub len: u32, + pub max: u32, + pub items: *mut *mut ::std::os::raw::c_void, + pub _space: [*mut ::std::os::raw::c_void; 6usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of small_arraylist_t"][::std::mem::size_of::() - 64usize]; + ["Alignment of small_arraylist_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: small_arraylist_t::len"] + [::std::mem::offset_of!(small_arraylist_t, len) - 0usize]; + ["Offset of field: small_arraylist_t::max"] + [::std::mem::offset_of!(small_arraylist_t, max) - 4usize]; + ["Offset of field: small_arraylist_t::items"] + [::std::mem::offset_of!(small_arraylist_t, items) - 8usize]; + ["Offset of field: small_arraylist_t::_space"] + [::std::mem::offset_of!(small_arraylist_t, _space) - 16usize]; +}; +pub type __jmp_buf = [::std::os::raw::c_long; 8usize]; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __jmp_buf_tag { @@ -440,1934 +188,469 @@ const _: () = { ["Offset of field: __jmp_buf_tag::__saved_mask"] [::std::mem::offset_of!(__jmp_buf_tag, __saved_mask) - 72usize]; }; -pub type jmp_buf = [__jmp_buf_tag; 1usize]; -extern "C" { - pub fn setjmp(__env: *mut __jmp_buf_tag) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __sigsetjmp( - __env: *mut __jmp_buf_tag, - __savemask: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _setjmp(__env: *mut __jmp_buf_tag) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn longjmp(__env: *mut __jmp_buf_tag, __val: ::std::os::raw::c_int) -> !; -} -extern "C" { - pub fn _longjmp(__env: *mut __jmp_buf_tag, __val: ::std::os::raw::c_int) -> !; -} pub type sigjmp_buf = [__jmp_buf_tag; 1usize]; -extern "C" { - pub fn siglongjmp(__env: *mut __jmp_buf_tag, __val: ::std::os::raw::c_int) -> !; -} -pub type __u_char = ::std::os::raw::c_uchar; -pub type __u_short = ::std::os::raw::c_ushort; -pub type __u_int = ::std::os::raw::c_uint; -pub type __u_long = ::std::os::raw::c_ulong; -pub type __int8_t = ::std::os::raw::c_schar; -pub type __uint8_t = ::std::os::raw::c_uchar; -pub type __int16_t = ::std::os::raw::c_short; -pub type __uint16_t = ::std::os::raw::c_ushort; -pub type __int32_t = ::std::os::raw::c_int; -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __int64_t = ::std::os::raw::c_long; -pub type __uint64_t = ::std::os::raw::c_ulong; -pub type __int_least8_t = __int8_t; -pub type __uint_least8_t = __uint8_t; -pub type __int_least16_t = __int16_t; -pub type __uint_least16_t = __uint16_t; -pub type __int_least32_t = __int32_t; -pub type __uint_least32_t = __uint32_t; -pub type __int_least64_t = __int64_t; -pub type __uint_least64_t = __uint64_t; -pub type __quad_t = ::std::os::raw::c_long; -pub type __u_quad_t = ::std::os::raw::c_ulong; -pub type __intmax_t = ::std::os::raw::c_long; -pub type __uintmax_t = ::std::os::raw::c_ulong; -pub type __dev_t = ::std::os::raw::c_ulong; -pub type __uid_t = ::std::os::raw::c_uint; -pub type __gid_t = ::std::os::raw::c_uint; -pub type __ino_t = ::std::os::raw::c_ulong; -pub type __ino64_t = ::std::os::raw::c_ulong; -pub type __mode_t = ::std::os::raw::c_uint; -pub type __nlink_t = ::std::os::raw::c_ulong; -pub type __off_t = ::std::os::raw::c_long; -pub type __off64_t = ::std::os::raw::c_long; -pub type __pid_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __fsid_t { - pub __val: [::std::os::raw::c_int; 2usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __fsid_t"][::std::mem::size_of::<__fsid_t>() - 8usize]; - ["Alignment of __fsid_t"][::std::mem::align_of::<__fsid_t>() - 4usize]; - ["Offset of field: __fsid_t::__val"][::std::mem::offset_of!(__fsid_t, __val) - 0usize]; -}; -pub type __clock_t = ::std::os::raw::c_long; -pub type __rlim_t = ::std::os::raw::c_ulong; -pub type __rlim64_t = ::std::os::raw::c_ulong; -pub type __id_t = ::std::os::raw::c_uint; -pub type __time_t = ::std::os::raw::c_long; -pub type __useconds_t = ::std::os::raw::c_uint; -pub type __suseconds_t = ::std::os::raw::c_long; -pub type __suseconds64_t = ::std::os::raw::c_long; -pub type __daddr_t = ::std::os::raw::c_int; -pub type __key_t = ::std::os::raw::c_int; -pub type __clockid_t = ::std::os::raw::c_int; -pub type __timer_t = *mut ::std::os::raw::c_void; -pub type __blksize_t = ::std::os::raw::c_long; -pub type __blkcnt_t = ::std::os::raw::c_long; -pub type __blkcnt64_t = ::std::os::raw::c_long; -pub type __fsblkcnt_t = ::std::os::raw::c_ulong; -pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; -pub type __fsword_t = ::std::os::raw::c_long; -pub type __ssize_t = ::std::os::raw::c_long; -pub type __syscall_slong_t = ::std::os::raw::c_long; -pub type __syscall_ulong_t = ::std::os::raw::c_ulong; -pub type __loff_t = __off64_t; -pub type __caddr_t = *mut ::std::os::raw::c_char; -pub type __intptr_t = ::std::os::raw::c_long; -pub type __socklen_t = ::std::os::raw::c_uint; -pub type __sig_atomic_t = ::std::os::raw::c_int; -pub type int_least8_t = __int_least8_t; -pub type int_least16_t = __int_least16_t; -pub type int_least32_t = __int_least32_t; -pub type int_least64_t = __int_least64_t; -pub type uint_least8_t = __uint_least8_t; -pub type uint_least16_t = __uint_least16_t; -pub type uint_least32_t = __uint_least32_t; -pub type uint_least64_t = __uint_least64_t; -pub type int_fast8_t = ::std::os::raw::c_schar; -pub type int_fast16_t = ::std::os::raw::c_long; -pub type int_fast32_t = ::std::os::raw::c_long; -pub type int_fast64_t = ::std::os::raw::c_long; -pub type uint_fast8_t = ::std::os::raw::c_uchar; -pub type uint_fast16_t = ::std::os::raw::c_ulong; -pub type uint_fast32_t = ::std::os::raw::c_ulong; -pub type uint_fast64_t = ::std::os::raw::c_ulong; -pub type intmax_t = __intmax_t; -pub type uintmax_t = __uintmax_t; -pub type time_t = __time_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timespec { - pub tv_sec: __time_t, - pub tv_nsec: __syscall_slong_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of timespec"][::std::mem::size_of::() - 16usize]; - ["Alignment of timespec"][::std::mem::align_of::() - 8usize]; - ["Offset of field: timespec::tv_sec"][::std::mem::offset_of!(timespec, tv_sec) - 0usize]; - ["Offset of field: timespec::tv_nsec"][::std::mem::offset_of!(timespec, tv_nsec) - 8usize]; -}; -pub type pid_t = __pid_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sched_param { - pub sched_priority: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of sched_param"][::std::mem::size_of::() - 4usize]; - ["Alignment of sched_param"][::std::mem::align_of::() - 4usize]; - ["Offset of field: sched_param::sched_priority"] - [::std::mem::offset_of!(sched_param, sched_priority) - 0usize]; -}; -extern "C" { - pub fn clone( - __fn: ::std::option::Option< - unsafe extern "C" fn(__arg: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, - >, - __child_stack: *mut ::std::os::raw::c_void, - __flags: ::std::os::raw::c_int, - __arg: *mut ::std::os::raw::c_void, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn unshare(__flags: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_getcpu() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getcpu( - arg1: *mut ::std::os::raw::c_uint, - arg2: *mut ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setns( - __fd: ::std::os::raw::c_int, - __nstype: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -pub type __cpu_mask = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct cpu_set_t { - pub __bits: [__cpu_mask; 16usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of cpu_set_t"][::std::mem::size_of::() - 128usize]; - ["Alignment of cpu_set_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: cpu_set_t::__bits"][::std::mem::offset_of!(cpu_set_t, __bits) - 0usize]; -}; -extern "C" { - pub fn __sched_cpucount(__setsize: usize, __setp: *const cpu_set_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __sched_cpualloc(__count: usize) -> *mut cpu_set_t; -} -extern "C" { - pub fn __sched_cpufree(__set: *mut cpu_set_t); -} -extern "C" { - pub fn sched_setparam(__pid: __pid_t, __param: *const sched_param) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_getparam(__pid: __pid_t, __param: *mut sched_param) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_setscheduler( - __pid: __pid_t, - __policy: ::std::os::raw::c_int, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_getscheduler(__pid: __pid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_yield() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_get_priority_max(__algorithm: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_get_priority_min(__algorithm: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_rr_get_interval(__pid: __pid_t, __t: *mut timespec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_setaffinity( - __pid: __pid_t, - __cpusetsize: usize, - __cpuset: *const cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sched_getaffinity( - __pid: __pid_t, - __cpusetsize: usize, - __cpuset: *mut cpu_set_t, - ) -> ::std::os::raw::c_int; -} +pub type jl_taggedvalue_t = _jl_taggedvalue_t; +pub type jl_ptls_t = *mut _jl_tls_states_t; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct timeval { - pub tv_sec: __time_t, - pub tv_usec: __suseconds_t, +pub struct _jl_value_t { + _unused: [u8; 0], } -#[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]; -}; +pub type sig_atomic_t = __sig_atomic_t; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct timex { - pub modes: ::std::os::raw::c_uint, - pub offset: __syscall_slong_t, - pub freq: __syscall_slong_t, - pub maxerror: __syscall_slong_t, - pub esterror: __syscall_slong_t, - pub status: ::std::os::raw::c_int, - pub constant: __syscall_slong_t, - pub precision: __syscall_slong_t, - pub tolerance: __syscall_slong_t, - pub time: timeval, - pub tick: __syscall_slong_t, - pub ppsfreq: __syscall_slong_t, - pub jitter: __syscall_slong_t, - pub shift: ::std::os::raw::c_int, - pub stabil: __syscall_slong_t, - pub jitcnt: __syscall_slong_t, - pub calcnt: __syscall_slong_t, - pub errcnt: __syscall_slong_t, - pub stbcnt: __syscall_slong_t, - pub tai: ::std::os::raw::c_int, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 44usize]>, +pub struct ws_array_t { + pub buffer: *mut ::std::os::raw::c_char, + pub capacity: i32, + pub mask: i32, } #[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]; + ["Size of ws_array_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of ws_array_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ws_array_t::buffer"][::std::mem::offset_of!(ws_array_t, buffer) - 0usize]; + ["Offset of field: ws_array_t::capacity"] + [::std::mem::offset_of!(ws_array_t, capacity) - 8usize]; + ["Offset of field: ws_array_t::mask"][::std::mem::offset_of!(ws_array_t, mask) - 12usize]; }; -extern "C" { - pub fn clock_adjtime(__clock_id: __clockid_t, __utx: *mut timex) -> ::std::os::raw::c_int; -} -pub type clock_t = __clock_t; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct tm { - pub tm_sec: ::std::os::raw::c_int, - pub tm_min: ::std::os::raw::c_int, - pub tm_hour: ::std::os::raw::c_int, - pub tm_mday: ::std::os::raw::c_int, - pub tm_mon: ::std::os::raw::c_int, - pub tm_year: ::std::os::raw::c_int, - pub tm_wday: ::std::os::raw::c_int, - pub tm_yday: ::std::os::raw::c_int, - pub tm_isdst: ::std::os::raw::c_int, - pub tm_gmtoff: ::std::os::raw::c_long, - pub tm_zone: *const ::std::os::raw::c_char, +#[repr(align(64))] +#[derive(Debug)] +pub struct ws_queue_t { + pub top: std_atomic, + pub __bindgen_padding_0: [u64; 7usize], + pub bottom: std_atomic, + pub __bindgen_padding_1: [u64; 7usize], + pub array: u64, } #[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]; + ["Size of ws_queue_t"][::std::mem::size_of::() - 192usize]; + ["Alignment of ws_queue_t"][::std::mem::align_of::() - 64usize]; + ["Offset of field: ws_queue_t::top"][::std::mem::offset_of!(ws_queue_t, top) - 0usize]; + ["Offset of field: ws_queue_t::bottom"][::std::mem::offset_of!(ws_queue_t, bottom) - 64usize]; + ["Offset of field: ws_queue_t::array"][::std::mem::offset_of!(ws_queue_t, array) - 128usize]; }; -pub type clockid_t = __clockid_t; -pub type timer_t = __timer_t; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct itimerspec { - pub it_interval: timespec, - pub it_value: timespec, +pub struct jl_gc_pool_t { + pub freelist: *mut _jl_taggedvalue_t, + pub newpages: *mut _jl_taggedvalue_t, + pub osize: u16, } #[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]; + ["Size of jl_gc_pool_t"][::std::mem::size_of::() - 24usize]; + ["Alignment of jl_gc_pool_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_gc_pool_t::freelist"] + [::std::mem::offset_of!(jl_gc_pool_t, freelist) - 0usize]; + ["Offset of field: jl_gc_pool_t::newpages"] + [::std::mem::offset_of!(jl_gc_pool_t, newpages) - 8usize]; + ["Offset of field: jl_gc_pool_t::osize"][::std::mem::offset_of!(jl_gc_pool_t, osize) - 16usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct sigevent { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __locale_struct { - pub __locales: [*mut __locale_data; 13usize], - pub __ctype_b: *const ::std::os::raw::c_ushort, - pub __ctype_tolower: *const ::std::os::raw::c_int, - pub __ctype_toupper: *const ::std::os::raw::c_int, - pub __names: [*const ::std::os::raw::c_char; 13usize], +pub struct jl_thread_heap_t { + pub young_generation_of_bigvals: *mut _bigval_t, + pub remset_nptr: ::std::os::raw::c_int, + pub remset: arraylist_t, + pub norm_pools: [jl_gc_pool_t; 51usize], } #[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]; + ["Size of jl_thread_heap_t"][::std::mem::size_of::() - 1496usize]; + ["Alignment of jl_thread_heap_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_thread_heap_t::young_generation_of_bigvals"] + [::std::mem::offset_of!(jl_thread_heap_t, young_generation_of_bigvals) - 0usize]; + ["Offset of field: jl_thread_heap_t::remset_nptr"] + [::std::mem::offset_of!(jl_thread_heap_t, remset_nptr) - 8usize]; + ["Offset of field: jl_thread_heap_t::remset"] + [::std::mem::offset_of!(jl_thread_heap_t, remset) - 16usize]; + ["Offset of field: jl_thread_heap_t::norm_pools"] + [::std::mem::offset_of!(jl_thread_heap_t, norm_pools) - 272usize]; }; -pub type __locale_t = *mut __locale_struct; -pub type locale_t = __locale_t; -extern "C" { - pub fn clock() -> clock_t; -} -extern "C" { - pub fn time(__timer: *mut time_t) -> time_t; -} -extern "C" { - pub fn difftime(__time1: time_t, __time0: time_t) -> f64; -} -extern "C" { - pub fn mktime(__tp: *mut tm) -> time_t; -} -extern "C" { - pub fn strftime( - __s: *mut ::std::os::raw::c_char, - __maxsize: usize, - __format: *const ::std::os::raw::c_char, - __tp: *const tm, - ) -> usize; -} -extern "C" { - pub fn strptime( - __s: *const ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - __tp: *mut tm, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strftime_l( - __s: *mut ::std::os::raw::c_char, - __maxsize: usize, - __format: *const ::std::os::raw::c_char, - __tp: *const tm, - __loc: locale_t, - ) -> usize; -} -extern "C" { - pub fn strptime_l( - __s: *const ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - __tp: *mut tm, - __loc: locale_t, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn gmtime(__timer: *const time_t) -> *mut tm; -} -extern "C" { - pub fn localtime(__timer: *const time_t) -> *mut tm; -} -extern "C" { - pub fn gmtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm; -} -extern "C" { - pub fn localtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm; -} -extern "C" { - pub fn asctime(__tp: *const tm) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ctime(__timer: *const time_t) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn asctime_r( - __tp: *const tm, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ctime_r( - __timer: *const time_t, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub static mut __tzname: [*mut ::std::os::raw::c_char; 2usize]; -} -extern "C" { - pub static mut __daylight: ::std::os::raw::c_int; -} -extern "C" { - pub static mut __timezone: ::std::os::raw::c_long; -} -extern "C" { - pub static mut tzname: [*mut ::std::os::raw::c_char; 2usize]; -} -extern "C" { - pub fn tzset(); -} -extern "C" { - pub static mut daylight: ::std::os::raw::c_int; -} -extern "C" { - pub static mut timezone: ::std::os::raw::c_long; -} -extern "C" { - pub fn timegm(__tp: *mut tm) -> time_t; -} -extern "C" { - pub fn timelocal(__tp: *mut tm) -> time_t; -} -extern "C" { - pub fn dysize(__year: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nanosleep( - __requested_time: *const timespec, - __remaining: *mut timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_getres(__clock_id: clockid_t, __res: *mut timespec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut timespec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_settime(__clock_id: clockid_t, __tp: *const timespec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_nanosleep( - __clock_id: clockid_t, - __flags: ::std::os::raw::c_int, - __req: *const timespec, - __rem: *mut timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clock_getcpuclockid(__pid: pid_t, __clock_id: *mut clockid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_create( - __clock_id: clockid_t, - __evp: *mut sigevent, - __timerid: *mut timer_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_delete(__timerid: timer_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_settime( - __timerid: timer_t, - __flags: ::std::os::raw::c_int, - __value: *const itimerspec, - __ovalue: *mut itimerspec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_gettime(__timerid: timer_t, __value: *mut itimerspec) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timer_getoverrun(__timerid: timer_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timespec_get( - __ts: *mut timespec, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn timespec_getres( - __ts: *mut timespec, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub static mut getdate_err: ::std::os::raw::c_int; -} -extern "C" { - pub fn getdate(__string: *const ::std::os::raw::c_char) -> *mut tm; -} -extern "C" { - pub fn getdate_r( - __string: *const ::std::os::raw::c_char, - __resbufp: *mut tm, - ) -> ::std::os::raw::c_int; -} #[repr(C)] -#[derive(Copy, Clone)] -pub union __atomic_wide_counter { - pub __value64: ::std::os::raw::c_ulonglong, - pub __value32: __atomic_wide_counter__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __atomic_wide_counter__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, +#[repr(align(64))] +#[derive(Debug)] +pub struct jl_gc_markqueue_t { + pub chunk_queue: ws_queue_t, + pub ptr_queue: ws_queue_t, + pub reclaim_set: arraylist_t, } #[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]; + ["Size of jl_gc_markqueue_t"][::std::mem::size_of::() - 640usize]; + ["Alignment of jl_gc_markqueue_t"][::std::mem::align_of::() - 64usize]; + ["Offset of field: jl_gc_markqueue_t::chunk_queue"] + [::std::mem::offset_of!(jl_gc_markqueue_t, chunk_queue) - 0usize]; + ["Offset of field: jl_gc_markqueue_t::ptr_queue"] + [::std::mem::offset_of!(jl_gc_markqueue_t, ptr_queue) - 192usize]; + ["Offset of field: jl_gc_markqueue_t::reclaim_set"] + [::std::mem::offset_of!(jl_gc_markqueue_t, reclaim_set) - 384usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_list { - pub __prev: *mut __pthread_internal_list, - pub __next: *mut __pthread_internal_list, +pub struct jl_gc_mark_cache_t { + pub perm_scanned_bytes: usize, + pub scanned_bytes: usize, } #[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]; + ["Size of jl_gc_mark_cache_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of jl_gc_mark_cache_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_gc_mark_cache_t::perm_scanned_bytes"] + [::std::mem::offset_of!(jl_gc_mark_cache_t, perm_scanned_bytes) - 0usize]; + ["Offset of field: jl_gc_mark_cache_t::scanned_bytes"] + [::std::mem::offset_of!(jl_gc_mark_cache_t, scanned_bytes) - 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, +pub struct jl_gc_page_stack_t { + pub bottom: u64, } #[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]; + ["Size of jl_gc_page_stack_t"][::std::mem::size_of::() - 8usize]; + ["Alignment of jl_gc_page_stack_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_gc_page_stack_t::bottom"] + [::std::mem::offset_of!(jl_gc_page_stack_t, bottom) - 0usize]; }; -pub type __pthread_slist_t = __pthread_internal_slist; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_mutex_s { - pub __lock: ::std::os::raw::c_int, - pub __count: ::std::os::raw::c_uint, - pub __owner: ::std::os::raw::c_int, - pub __nusers: ::std::os::raw::c_uint, - pub __kind: ::std::os::raw::c_int, - pub __spins: ::std::os::raw::c_short, - pub __elision: ::std::os::raw::c_short, - pub __list: __pthread_list_t, +#[repr(align(64))] +#[derive(Debug)] +pub struct jl_gc_tls_states_t { + pub heap: jl_thread_heap_t, + pub page_metadata_allocd: jl_gc_page_stack_t, + pub __bindgen_padding_0: [u64; 4usize], + pub mark_queue: jl_gc_markqueue_t, + pub gc_cache: jl_gc_mark_cache_t, + pub gc_sweeps_requested: std_atomic, + pub sweep_objs: arraylist_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of jl_gc_tls_states_t"][::std::mem::size_of::() - 2496usize]; + ["Alignment of jl_gc_tls_states_t"][::std::mem::align_of::() - 64usize]; + ["Offset of field: jl_gc_tls_states_t::heap"] + [::std::mem::offset_of!(jl_gc_tls_states_t, heap) - 0usize]; + ["Offset of field: jl_gc_tls_states_t::page_metadata_allocd"] + [::std::mem::offset_of!(jl_gc_tls_states_t, page_metadata_allocd) - 1496usize]; + ["Offset of field: jl_gc_tls_states_t::mark_queue"] + [::std::mem::offset_of!(jl_gc_tls_states_t, mark_queue) - 1536usize]; + ["Offset of field: jl_gc_tls_states_t::gc_cache"] + [::std::mem::offset_of!(jl_gc_tls_states_t, gc_cache) - 2176usize]; + ["Offset of field: jl_gc_tls_states_t::gc_sweeps_requested"] + [::std::mem::offset_of!(jl_gc_tls_states_t, gc_sweeps_requested) - 2192usize]; + ["Offset of field: jl_gc_tls_states_t::sweep_objs"] + [::std::mem::offset_of!(jl_gc_tls_states_t, sweep_objs) - 2200usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct jl_thread_heap_common_t { + pub weak_refs: small_arraylist_t, + pub live_tasks: small_arraylist_t, + pub mallocarrays: *mut _mallocmemory_t, + pub mafreelist: *mut _mallocmemory_t, + pub free_stacks: [small_arraylist_t; 16usize], } #[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]; + ["Size of jl_thread_heap_common_t"] + [::std::mem::size_of::() - 1168usize]; + ["Alignment of jl_thread_heap_common_t"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_thread_heap_common_t::weak_refs"] + [::std::mem::offset_of!(jl_thread_heap_common_t, weak_refs) - 0usize]; + ["Offset of field: jl_thread_heap_common_t::live_tasks"] + [::std::mem::offset_of!(jl_thread_heap_common_t, live_tasks) - 64usize]; + ["Offset of field: jl_thread_heap_common_t::mallocarrays"] + [::std::mem::offset_of!(jl_thread_heap_common_t, mallocarrays) - 128usize]; + ["Offset of field: jl_thread_heap_common_t::mafreelist"] + [::std::mem::offset_of!(jl_thread_heap_common_t, mafreelist) - 136usize]; + ["Offset of field: jl_thread_heap_common_t::free_stacks"] + [::std::mem::offset_of!(jl_thread_heap_common_t, free_stacks) - 144usize]; }; #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_rwlock_arch_t { - pub __readers: ::std::os::raw::c_uint, - pub __writers: ::std::os::raw::c_uint, - pub __wrphase_futex: ::std::os::raw::c_uint, - pub __writers_futex: ::std::os::raw::c_uint, - pub __pad3: ::std::os::raw::c_uint, - pub __pad4: ::std::os::raw::c_uint, - pub __cur_writer: ::std::os::raw::c_int, - pub __shared: ::std::os::raw::c_int, - pub __rwelision: ::std::os::raw::c_schar, - pub __pad1: [::std::os::raw::c_uchar; 7usize], - pub __pad2: ::std::os::raw::c_ulong, - pub __flags: ::std::os::raw::c_uint, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_rwlock_arch_t"][::std::mem::size_of::<__pthread_rwlock_arch_t>() - 56usize]; - ["Alignment of __pthread_rwlock_arch_t"] - [::std::mem::align_of::<__pthread_rwlock_arch_t>() - 8usize]; - ["Offset of field: __pthread_rwlock_arch_t::__readers"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __readers) - 0usize]; - ["Offset of field: __pthread_rwlock_arch_t::__writers"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __writers) - 4usize]; - ["Offset of field: __pthread_rwlock_arch_t::__wrphase_futex"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __wrphase_futex) - 8usize]; - ["Offset of field: __pthread_rwlock_arch_t::__writers_futex"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __writers_futex) - 12usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad3"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad3) - 16usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad4"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad4) - 20usize]; - ["Offset of field: __pthread_rwlock_arch_t::__cur_writer"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __cur_writer) - 24usize]; - ["Offset of field: __pthread_rwlock_arch_t::__shared"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __shared) - 28usize]; - ["Offset of field: __pthread_rwlock_arch_t::__rwelision"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __rwelision) - 32usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad1"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad1) - 33usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad2"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad2) - 40usize]; - ["Offset of field: __pthread_rwlock_arch_t::__flags"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __flags) - 48usize]; +#[derive(Debug)] +pub struct jl_thread_gc_num_common_t { + pub allocd: std_atomic, + pub pool_live_bytes: std_atomic, + pub malloc: std_atomic, + pub realloc: std_atomic, + pub poolalloc: std_atomic, + pub bigalloc: std_atomic, + pub free_acc: std_atomic, + pub alloc_acc: std_atomic, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of jl_thread_gc_num_common_t"] + [::std::mem::size_of::() - 64usize]; + ["Alignment of jl_thread_gc_num_common_t"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_thread_gc_num_common_t::allocd"] + [::std::mem::offset_of!(jl_thread_gc_num_common_t, allocd) - 0usize]; + ["Offset of field: jl_thread_gc_num_common_t::pool_live_bytes"] + [::std::mem::offset_of!(jl_thread_gc_num_common_t, pool_live_bytes) - 8usize]; + ["Offset of field: jl_thread_gc_num_common_t::malloc"] + [::std::mem::offset_of!(jl_thread_gc_num_common_t, malloc) - 16usize]; + ["Offset of field: jl_thread_gc_num_common_t::realloc"] + [::std::mem::offset_of!(jl_thread_gc_num_common_t, realloc) - 24usize]; + ["Offset of field: jl_thread_gc_num_common_t::poolalloc"] + [::std::mem::offset_of!(jl_thread_gc_num_common_t, poolalloc) - 32usize]; + ["Offset of field: jl_thread_gc_num_common_t::bigalloc"] + [::std::mem::offset_of!(jl_thread_gc_num_common_t, bigalloc) - 40usize]; + ["Offset of field: jl_thread_gc_num_common_t::free_acc"] + [::std::mem::offset_of!(jl_thread_gc_num_common_t, free_acc) - 48usize]; + ["Offset of field: jl_thread_gc_num_common_t::alloc_acc"] + [::std::mem::offset_of!(jl_thread_gc_num_common_t, alloc_acc) - 56usize]; }; #[repr(C)] -#[derive(Copy, Clone)] -pub struct __pthread_cond_s { - pub __wseq: __atomic_wide_counter, - pub __g1_start: __atomic_wide_counter, - pub __g_refs: [::std::os::raw::c_uint; 2usize], - pub __g_size: [::std::os::raw::c_uint; 2usize], - pub __g1_orig_size: ::std::os::raw::c_uint, - pub __wrefs: ::std::os::raw::c_uint, - pub __g_signals: [::std::os::raw::c_uint; 2usize], +#[derive(Debug)] +pub struct jl_gc_tls_states_common_t { + pub heap: jl_thread_heap_common_t, + pub gc_num: jl_thread_gc_num_common_t, } #[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]; + ["Size of jl_gc_tls_states_common_t"] + [::std::mem::size_of::() - 1232usize]; + ["Alignment of jl_gc_tls_states_common_t"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_gc_tls_states_common_t::heap"] + [::std::mem::offset_of!(jl_gc_tls_states_common_t, heap) - 0usize]; + ["Offset of field: jl_gc_tls_states_common_t::gc_num"] + [::std::mem::offset_of!(jl_gc_tls_states_common_t, gc_num) - 1168usize]; }; -pub type __tss_t = ::std::os::raw::c_uint; -pub type __thrd_t = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __once_flag { - pub __data: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __once_flag"][::std::mem::size_of::<__once_flag>() - 4usize]; - ["Alignment of __once_flag"][::std::mem::align_of::<__once_flag>() - 4usize]; - ["Offset of field: __once_flag::__data"][::std::mem::offset_of!(__once_flag, __data) - 0usize]; -}; -pub type pthread_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutexattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, +pub struct jl_stack_context_t { + pub uc_mcontext: sigjmp_buf, } #[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]; + ["Size of jl_stack_context_t"][::std::mem::size_of::() - 200usize]; + ["Alignment of jl_stack_context_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_stack_context_t::uc_mcontext"] + [::std::mem::offset_of!(jl_stack_context_t, uc_mcontext) - 0usize]; }; +pub type _jl_ucontext_t = jl_stack_context_t; #[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, +pub struct jl_ucontext_t { + pub __bindgen_anon_1: 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, } -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_condattr_t"][::std::mem::size_of::() - 4usize]; - ["Alignment of pthread_condattr_t"][::std::mem::align_of::() - 4usize]; - ["Offset of field: pthread_condattr_t::__size"] - [::std::mem::offset_of!(pthread_condattr_t, __size) - 0usize]; - ["Offset of field: pthread_condattr_t::__align"] - [::std::mem::offset_of!(pthread_condattr_t, __align) - 0usize]; -}; -pub type pthread_key_t = ::std::os::raw::c_uint; -pub type pthread_once_t = ::std::os::raw::c_int; #[repr(C)] #[derive(Copy, Clone)] -pub union pthread_attr_t { - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, +pub union jl_ucontext_t__bindgen_ty_1 { + pub ctx: *mut _jl_ucontext_t, + pub copy_ctx: *mut jl_stack_context_t, } #[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]; + ["Size of jl_ucontext_t__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of jl_ucontext_t__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_ucontext_t__bindgen_ty_1::ctx"] + [::std::mem::offset_of!(jl_ucontext_t__bindgen_ty_1, ctx) - 0usize]; + ["Offset of field: jl_ucontext_t__bindgen_ty_1::copy_ctx"] + [::std::mem::offset_of!(jl_ucontext_t__bindgen_ty_1, copy_ctx) - 0usize]; }; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutex_t { - pub __data: __pthread_mutex_s, - pub __size: [::std::os::raw::c_char; 40usize], - pub __align: ::std::os::raw::c_long, -} #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of pthread_mutex_t"][::std::mem::size_of::() - 40usize]; - ["Alignment of pthread_mutex_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_mutex_t::__data"] - [::std::mem::offset_of!(pthread_mutex_t, __data) - 0usize]; - ["Offset of field: pthread_mutex_t::__size"] - [::std::mem::offset_of!(pthread_mutex_t, __size) - 0usize]; - ["Offset of field: pthread_mutex_t::__align"] - [::std::mem::offset_of!(pthread_mutex_t, __align) - 0usize]; + ["Size of jl_ucontext_t"][::std::mem::size_of::() - 32usize]; + ["Alignment of jl_ucontext_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_ucontext_t::stkbuf"] + [::std::mem::offset_of!(jl_ucontext_t, stkbuf) - 8usize]; + ["Offset of field: jl_ucontext_t::bufsz"] + [::std::mem::offset_of!(jl_ucontext_t, bufsz) - 16usize]; }; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_cond_t { - pub __data: __pthread_cond_s, - pub __size: [::std::os::raw::c_char; 48usize], - pub __align: ::std::os::raw::c_longlong, +impl 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 + } } -#[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]; -}; +pub type jl_thread_t = pthread_t; #[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlock_t { - pub __data: __pthread_rwlock_arch_t, - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, +#[derive(Debug, Copy, Clone)] +pub struct jl_mutex_t { + pub owner: u64, + pub count: u32, } #[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]; + ["Size of jl_mutex_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of jl_mutex_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_mutex_t::owner"][::std::mem::offset_of!(jl_mutex_t, owner) - 0usize]; + ["Offset of field: jl_mutex_t::count"][::std::mem::offset_of!(jl_mutex_t, count) - 8usize]; }; #[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, +#[repr(align(64))] +#[derive(Debug)] +pub struct _jl_tls_states_t { + pub tid: i16, + pub threadpoolid: i8, + pub rngseed: u64, + pub safepoint: u64, + pub sleep_check_state: std_atomic, + pub gc_state: std_atomic, + pub in_pure_callback: i16, + 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: jl_gc_tls_states_t, + pub gc_tls_common: jl_gc_tls_states_common_t, + pub defer_signal: sig_atomic_t, + pub current_task: u64, + pub next_task: *mut _jl_task_t, + pub previous_task: *mut _jl_task_t, + pub root_task: *mut _jl_task_t, + pub timing_stack: *mut _jl_timing_block_t, + pub stackbase: *mut ::std::os::raw::c_void, + pub stacksize: usize, + pub sig_exception: *mut _jl_value_t, + pub bt_data: *mut _jl_bt_element_t, + pub bt_size: usize, + pub profiling_bt_buffer: *mut _jl_bt_element_t, + pub signal_request: std_atomic, + pub io_wait: sig_atomic_t, + pub signal_stack: *mut ::std::os::raw::c_void, + pub signal_stack_size: usize, + pub system_id: jl_thread_t, + pub suspend_count: std_atomic, + pub finalizers: arraylist_t, + pub previous_exception: *mut _jl_value_t, + pub locks: small_arraylist_t, + pub engine_nqueued: usize, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of pthread_rwlockattr_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of pthread_rwlockattr_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_rwlockattr_t::__size"] - [::std::mem::offset_of!(pthread_rwlockattr_t, __size) - 0usize]; - ["Offset of field: pthread_rwlockattr_t::__align"] - [::std::mem::offset_of!(pthread_rwlockattr_t, __align) - 0usize]; -}; -pub type pthread_spinlock_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrier_t { - pub __size: [::std::os::raw::c_char; 32usize], - pub __align: ::std::os::raw::c_long, + ["Size of _jl_tls_states_t"][::std::mem::size_of::<_jl_tls_states_t>() - 4288usize]; + ["Alignment of _jl_tls_states_t"][::std::mem::align_of::<_jl_tls_states_t>() - 64usize]; + ["Offset of field: _jl_tls_states_t::tid"] + [::std::mem::offset_of!(_jl_tls_states_t, tid) - 0usize]; + ["Offset of field: _jl_tls_states_t::threadpoolid"] + [::std::mem::offset_of!(_jl_tls_states_t, threadpoolid) - 2usize]; + ["Offset of field: _jl_tls_states_t::rngseed"] + [::std::mem::offset_of!(_jl_tls_states_t, rngseed) - 8usize]; + ["Offset of field: _jl_tls_states_t::safepoint"] + [::std::mem::offset_of!(_jl_tls_states_t, safepoint) - 16usize]; + ["Offset of field: _jl_tls_states_t::sleep_check_state"] + [::std::mem::offset_of!(_jl_tls_states_t, sleep_check_state) - 24usize]; + ["Offset of field: _jl_tls_states_t::gc_state"] + [::std::mem::offset_of!(_jl_tls_states_t, gc_state) - 25usize]; + ["Offset of field: _jl_tls_states_t::in_pure_callback"] + [::std::mem::offset_of!(_jl_tls_states_t, in_pure_callback) - 26usize]; + ["Offset of field: _jl_tls_states_t::in_finalizer"] + [::std::mem::offset_of!(_jl_tls_states_t, in_finalizer) - 28usize]; + ["Offset of field: _jl_tls_states_t::disable_gc"] + [::std::mem::offset_of!(_jl_tls_states_t, disable_gc) - 30usize]; + ["Offset of field: _jl_tls_states_t::finalizers_inhibited"] + [::std::mem::offset_of!(_jl_tls_states_t, finalizers_inhibited) - 32usize]; + ["Offset of field: _jl_tls_states_t::gc_tls"] + [::std::mem::offset_of!(_jl_tls_states_t, gc_tls) - 64usize]; + ["Offset of field: _jl_tls_states_t::gc_tls_common"] + [::std::mem::offset_of!(_jl_tls_states_t, gc_tls_common) - 2560usize]; + ["Offset of field: _jl_tls_states_t::defer_signal"] + [::std::mem::offset_of!(_jl_tls_states_t, defer_signal) - 3792usize]; + ["Offset of field: _jl_tls_states_t::current_task"] + [::std::mem::offset_of!(_jl_tls_states_t, current_task) - 3800usize]; + ["Offset of field: _jl_tls_states_t::next_task"] + [::std::mem::offset_of!(_jl_tls_states_t, next_task) - 3808usize]; + ["Offset of field: _jl_tls_states_t::previous_task"] + [::std::mem::offset_of!(_jl_tls_states_t, previous_task) - 3816usize]; + ["Offset of field: _jl_tls_states_t::root_task"] + [::std::mem::offset_of!(_jl_tls_states_t, root_task) - 3824usize]; + ["Offset of field: _jl_tls_states_t::timing_stack"] + [::std::mem::offset_of!(_jl_tls_states_t, timing_stack) - 3832usize]; + ["Offset of field: _jl_tls_states_t::stackbase"] + [::std::mem::offset_of!(_jl_tls_states_t, stackbase) - 3840usize]; + ["Offset of field: _jl_tls_states_t::stacksize"] + [::std::mem::offset_of!(_jl_tls_states_t, stacksize) - 3848usize]; + ["Offset of field: _jl_tls_states_t::sig_exception"] + [::std::mem::offset_of!(_jl_tls_states_t, sig_exception) - 3856usize]; + ["Offset of field: _jl_tls_states_t::bt_data"] + [::std::mem::offset_of!(_jl_tls_states_t, bt_data) - 3864usize]; + ["Offset of field: _jl_tls_states_t::bt_size"] + [::std::mem::offset_of!(_jl_tls_states_t, bt_size) - 3872usize]; + ["Offset of field: _jl_tls_states_t::profiling_bt_buffer"] + [::std::mem::offset_of!(_jl_tls_states_t, profiling_bt_buffer) - 3880usize]; + ["Offset of field: _jl_tls_states_t::signal_request"] + [::std::mem::offset_of!(_jl_tls_states_t, signal_request) - 3888usize]; + ["Offset of field: _jl_tls_states_t::io_wait"] + [::std::mem::offset_of!(_jl_tls_states_t, io_wait) - 3892usize]; + ["Offset of field: _jl_tls_states_t::signal_stack"] + [::std::mem::offset_of!(_jl_tls_states_t, signal_stack) - 3896usize]; + ["Offset of field: _jl_tls_states_t::signal_stack_size"] + [::std::mem::offset_of!(_jl_tls_states_t, signal_stack_size) - 3904usize]; + ["Offset of field: _jl_tls_states_t::system_id"] + [::std::mem::offset_of!(_jl_tls_states_t, system_id) - 3912usize]; + ["Offset of field: _jl_tls_states_t::suspend_count"] + [::std::mem::offset_of!(_jl_tls_states_t, suspend_count) - 3920usize]; + ["Offset of field: _jl_tls_states_t::finalizers"] + [::std::mem::offset_of!(_jl_tls_states_t, finalizers) - 3928usize]; + ["Offset of field: _jl_tls_states_t::previous_exception"] + [::std::mem::offset_of!(_jl_tls_states_t, previous_exception) - 4184usize]; + ["Offset of field: _jl_tls_states_t::locks"] + [::std::mem::offset_of!(_jl_tls_states_t, locks) - 4192usize]; + ["Offset of field: _jl_tls_states_t::engine_nqueued"] + [::std::mem::offset_of!(_jl_tls_states_t, engine_nqueued) - 4256usize]; +}; +pub type jl_value_t = _jl_value_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _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 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]; + ["Size of _jl_taggedvalue_bits"][::std::mem::size_of::<_jl_taggedvalue_bits>() - 8usize]; + ["Alignment of _jl_taggedvalue_bits"][::std::mem::align_of::<_jl_taggedvalue_bits>() - 8usize]; }; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrierattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_barrierattr_t"][::std::mem::size_of::() - 4usize]; - ["Alignment of pthread_barrierattr_t"] - [::std::mem::align_of::() - 4usize]; - ["Offset of field: pthread_barrierattr_t::__size"] - [::std::mem::offset_of!(pthread_barrierattr_t, __size) - 0usize]; - ["Offset of field: pthread_barrierattr_t::__align"] - [::std::mem::offset_of!(pthread_barrierattr_t, __align) - 0usize]; -}; -extern "C" { - pub fn __sysconf(__name: ::std::os::raw::c_int) -> ::std::os::raw::c_long; -} -pub const PTHREAD_CREATE_JOINABLE: _bindgen_ty_1 = 0; -pub const PTHREAD_CREATE_DETACHED: _bindgen_ty_1 = 1; -pub type _bindgen_ty_1 = ::std::os::raw::c_uint; -pub const PTHREAD_MUTEX_TIMED_NP: _bindgen_ty_2 = 0; -pub const PTHREAD_MUTEX_RECURSIVE_NP: _bindgen_ty_2 = 1; -pub const PTHREAD_MUTEX_ERRORCHECK_NP: _bindgen_ty_2 = 2; -pub const PTHREAD_MUTEX_ADAPTIVE_NP: _bindgen_ty_2 = 3; -pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_2 = 0; -pub const PTHREAD_MUTEX_RECURSIVE: _bindgen_ty_2 = 1; -pub const PTHREAD_MUTEX_ERRORCHECK: _bindgen_ty_2 = 2; -pub const PTHREAD_MUTEX_DEFAULT: _bindgen_ty_2 = 0; -pub const PTHREAD_MUTEX_FAST_NP: _bindgen_ty_2 = 0; -pub type _bindgen_ty_2 = ::std::os::raw::c_uint; -pub const PTHREAD_MUTEX_STALLED: _bindgen_ty_3 = 0; -pub const PTHREAD_MUTEX_STALLED_NP: _bindgen_ty_3 = 0; -pub const PTHREAD_MUTEX_ROBUST: _bindgen_ty_3 = 1; -pub const PTHREAD_MUTEX_ROBUST_NP: _bindgen_ty_3 = 1; -pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -pub const PTHREAD_PRIO_NONE: _bindgen_ty_4 = 0; -pub const PTHREAD_PRIO_INHERIT: _bindgen_ty_4 = 1; -pub const PTHREAD_PRIO_PROTECT: _bindgen_ty_4 = 2; -pub type _bindgen_ty_4 = ::std::os::raw::c_uint; -pub const PTHREAD_RWLOCK_PREFER_READER_NP: _bindgen_ty_5 = 0; -pub const PTHREAD_RWLOCK_PREFER_WRITER_NP: _bindgen_ty_5 = 1; -pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: _bindgen_ty_5 = 2; -pub const PTHREAD_RWLOCK_DEFAULT_NP: _bindgen_ty_5 = 0; -pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -pub const PTHREAD_INHERIT_SCHED: _bindgen_ty_6 = 0; -pub const PTHREAD_EXPLICIT_SCHED: _bindgen_ty_6 = 1; -pub type _bindgen_ty_6 = ::std::os::raw::c_uint; -pub const PTHREAD_SCOPE_SYSTEM: _bindgen_ty_7 = 0; -pub const PTHREAD_SCOPE_PROCESS: _bindgen_ty_7 = 1; -pub type _bindgen_ty_7 = ::std::os::raw::c_uint; -pub const PTHREAD_PROCESS_PRIVATE: _bindgen_ty_8 = 0; -pub const PTHREAD_PROCESS_SHARED: _bindgen_ty_8 = 1; -pub type _bindgen_ty_8 = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _pthread_cleanup_buffer { - pub __routine: ::std::option::Option, - pub __arg: *mut ::std::os::raw::c_void, - pub __canceltype: ::std::os::raw::c_int, - pub __prev: *mut _pthread_cleanup_buffer, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _pthread_cleanup_buffer"][::std::mem::size_of::<_pthread_cleanup_buffer>() - 32usize]; - ["Alignment of _pthread_cleanup_buffer"] - [::std::mem::align_of::<_pthread_cleanup_buffer>() - 8usize]; - ["Offset of field: _pthread_cleanup_buffer::__routine"] - [::std::mem::offset_of!(_pthread_cleanup_buffer, __routine) - 0usize]; - ["Offset of field: _pthread_cleanup_buffer::__arg"] - [::std::mem::offset_of!(_pthread_cleanup_buffer, __arg) - 8usize]; - ["Offset of field: _pthread_cleanup_buffer::__canceltype"] - [::std::mem::offset_of!(_pthread_cleanup_buffer, __canceltype) - 16usize]; - ["Offset of field: _pthread_cleanup_buffer::__prev"] - [::std::mem::offset_of!(_pthread_cleanup_buffer, __prev) - 24usize]; -}; -pub const PTHREAD_CANCEL_ENABLE: _bindgen_ty_9 = 0; -pub const PTHREAD_CANCEL_DISABLE: _bindgen_ty_9 = 1; -pub type _bindgen_ty_9 = ::std::os::raw::c_uint; -pub const PTHREAD_CANCEL_DEFERRED: _bindgen_ty_10 = 0; -pub const PTHREAD_CANCEL_ASYNCHRONOUS: _bindgen_ty_10 = 1; -pub type _bindgen_ty_10 = ::std::os::raw::c_uint; -extern "C" { - pub fn pthread_create( - __newthread: *mut pthread_t, - __attr: *const pthread_attr_t, - __start_routine: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void, - >, - __arg: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_exit(__retval: *mut ::std::os::raw::c_void) -> !; -} -extern "C" { - pub fn pthread_join( - __th: pthread_t, - __thread_return: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_tryjoin_np( - __th: pthread_t, - __thread_return: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_timedjoin_np( - __th: pthread_t, - __thread_return: *mut *mut ::std::os::raw::c_void, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_clockjoin_np( - __th: pthread_t, - __thread_return: *mut *mut ::std::os::raw::c_void, - __clockid: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_detach(__th: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_self() -> pthread_t; -} -extern "C" { - pub fn pthread_equal(__thread1: pthread_t, __thread2: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_init(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_destroy(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getdetachstate( - __attr: *const pthread_attr_t, - __detachstate: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setdetachstate( - __attr: *mut pthread_attr_t, - __detachstate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getguardsize( - __attr: *const pthread_attr_t, - __guardsize: *mut usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setguardsize( - __attr: *mut pthread_attr_t, - __guardsize: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedparam( - __attr: *const pthread_attr_t, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedparam( - __attr: *mut pthread_attr_t, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getschedpolicy( - __attr: *const pthread_attr_t, - __policy: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setschedpolicy( - __attr: *mut pthread_attr_t, - __policy: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getinheritsched( - __attr: *const pthread_attr_t, - __inherit: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setinheritsched( - __attr: *mut pthread_attr_t, - __inherit: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getscope( - __attr: *const pthread_attr_t, - __scope: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setscope( - __attr: *mut pthread_attr_t, - __scope: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstackaddr( - __attr: *const pthread_attr_t, - __stackaddr: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstackaddr( - __attr: *mut pthread_attr_t, - __stackaddr: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstacksize( - __attr: *const pthread_attr_t, - __stacksize: *mut usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstacksize( - __attr: *mut pthread_attr_t, - __stacksize: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getstack( - __attr: *const pthread_attr_t, - __stackaddr: *mut *mut ::std::os::raw::c_void, - __stacksize: *mut usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setstack( - __attr: *mut pthread_attr_t, - __stackaddr: *mut ::std::os::raw::c_void, - __stacksize: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setaffinity_np( - __attr: *mut pthread_attr_t, - __cpusetsize: usize, - __cpuset: *const cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getaffinity_np( - __attr: *const pthread_attr_t, - __cpusetsize: usize, - __cpuset: *mut cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getattr_default_np(__attr: *mut pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_setsigmask_np( - __attr: *mut pthread_attr_t, - sigmask: *const __sigset_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_attr_getsigmask_np( - __attr: *const pthread_attr_t, - sigmask: *mut __sigset_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setattr_default_np(__attr: *const pthread_attr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getattr_np( - __th: pthread_t, - __attr: *mut pthread_attr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedparam( - __target_thread: pthread_t, - __policy: ::std::os::raw::c_int, - __param: *const sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getschedparam( - __target_thread: pthread_t, - __policy: *mut ::std::os::raw::c_int, - __param: *mut sched_param, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setschedprio( - __target_thread: pthread_t, - __prio: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getname_np( - __target_thread: pthread_t, - __buf: *mut ::std::os::raw::c_char, - __buflen: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setname_np( - __target_thread: pthread_t, - __name: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getconcurrency() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setconcurrency(__level: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_yield() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setaffinity_np( - __th: pthread_t, - __cpusetsize: usize, - __cpuset: *const cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getaffinity_np( - __th: pthread_t, - __cpusetsize: usize, - __cpuset: *mut cpu_set_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_once( - __once_control: *mut pthread_once_t, - __init_routine: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setcancelstate( - __state: ::std::os::raw::c_int, - __oldstate: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_setcanceltype( - __type: ::std::os::raw::c_int, - __oldtype: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cancel(__th: pthread_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_testcancel(); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __cancel_jmp_buf_tag { - pub __cancel_jmp_buf: __jmp_buf, - pub __mask_was_saved: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __cancel_jmp_buf_tag"][::std::mem::size_of::<__cancel_jmp_buf_tag>() - 72usize]; - ["Alignment of __cancel_jmp_buf_tag"][::std::mem::align_of::<__cancel_jmp_buf_tag>() - 8usize]; - ["Offset of field: __cancel_jmp_buf_tag::__cancel_jmp_buf"] - [::std::mem::offset_of!(__cancel_jmp_buf_tag, __cancel_jmp_buf) - 0usize]; - ["Offset of field: __cancel_jmp_buf_tag::__mask_was_saved"] - [::std::mem::offset_of!(__cancel_jmp_buf_tag, __mask_was_saved) - 64usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_unwind_buf_t { - pub __cancel_jmp_buf: [__cancel_jmp_buf_tag; 1usize], - pub __pad: [*mut ::std::os::raw::c_void; 4usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_unwind_buf_t"][::std::mem::size_of::<__pthread_unwind_buf_t>() - 104usize]; - ["Alignment of __pthread_unwind_buf_t"] - [::std::mem::align_of::<__pthread_unwind_buf_t>() - 8usize]; - ["Offset of field: __pthread_unwind_buf_t::__cancel_jmp_buf"] - [::std::mem::offset_of!(__pthread_unwind_buf_t, __cancel_jmp_buf) - 0usize]; - ["Offset of field: __pthread_unwind_buf_t::__pad"] - [::std::mem::offset_of!(__pthread_unwind_buf_t, __pad) - 72usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_cleanup_frame { - pub __cancel_routine: - ::std::option::Option, - pub __cancel_arg: *mut ::std::os::raw::c_void, - pub __do_it: ::std::os::raw::c_int, - pub __cancel_type: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_cleanup_frame"][::std::mem::size_of::<__pthread_cleanup_frame>() - 24usize]; - ["Alignment of __pthread_cleanup_frame"] - [::std::mem::align_of::<__pthread_cleanup_frame>() - 8usize]; - ["Offset of field: __pthread_cleanup_frame::__cancel_routine"] - [::std::mem::offset_of!(__pthread_cleanup_frame, __cancel_routine) - 0usize]; - ["Offset of field: __pthread_cleanup_frame::__cancel_arg"] - [::std::mem::offset_of!(__pthread_cleanup_frame, __cancel_arg) - 8usize]; - ["Offset of field: __pthread_cleanup_frame::__do_it"] - [::std::mem::offset_of!(__pthread_cleanup_frame, __do_it) - 16usize]; - ["Offset of field: __pthread_cleanup_frame::__cancel_type"] - [::std::mem::offset_of!(__pthread_cleanup_frame, __cancel_type) - 20usize]; -}; -#[repr(C)] -#[derive(Debug)] -pub struct __pthread_cleanup_class { - pub __cancel_routine: - ::std::option::Option, - pub __cancel_arg: *mut ::std::os::raw::c_void, - pub __do_it: ::std::os::raw::c_int, - pub __cancel_type: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_cleanup_class"][::std::mem::size_of::<__pthread_cleanup_class>() - 24usize]; - ["Alignment of __pthread_cleanup_class"] - [::std::mem::align_of::<__pthread_cleanup_class>() - 8usize]; - ["Offset of field: __pthread_cleanup_class::__cancel_routine"] - [::std::mem::offset_of!(__pthread_cleanup_class, __cancel_routine) - 0usize]; - ["Offset of field: __pthread_cleanup_class::__cancel_arg"] - [::std::mem::offset_of!(__pthread_cleanup_class, __cancel_arg) - 8usize]; - ["Offset of field: __pthread_cleanup_class::__do_it"] - [::std::mem::offset_of!(__pthread_cleanup_class, __do_it) - 16usize]; - ["Offset of field: __pthread_cleanup_class::__cancel_type"] - [::std::mem::offset_of!(__pthread_cleanup_class, __cancel_type) - 20usize]; -}; -extern "C" { - pub fn pthread_mutex_init( - __mutex: *mut pthread_mutex_t, - __mutexattr: *const pthread_mutexattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_destroy(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_trylock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_lock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_timedlock( - __mutex: *mut pthread_mutex_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_clocklock( - __mutex: *mut pthread_mutex_t, - __clockid: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_unlock(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_getprioceiling( - __mutex: *const pthread_mutex_t, - __prioceiling: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_setprioceiling( - __mutex: *mut pthread_mutex_t, - __prioceiling: ::std::os::raw::c_int, - __old_ceiling: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutex_consistent(__mutex: *mut pthread_mutex_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_init(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_destroy(__attr: *mut pthread_mutexattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getpshared( - __attr: *const pthread_mutexattr_t, - __pshared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setpshared( - __attr: *mut pthread_mutexattr_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_gettype( - __attr: *const pthread_mutexattr_t, - __kind: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_settype( - __attr: *mut pthread_mutexattr_t, - __kind: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getprotocol( - __attr: *const pthread_mutexattr_t, - __protocol: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setprotocol( - __attr: *mut pthread_mutexattr_t, - __protocol: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getprioceiling( - __attr: *const pthread_mutexattr_t, - __prioceiling: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setprioceiling( - __attr: *mut pthread_mutexattr_t, - __prioceiling: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_getrobust( - __attr: *const pthread_mutexattr_t, - __robustness: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_mutexattr_setrobust( - __attr: *mut pthread_mutexattr_t, - __robustness: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_init( - __rwlock: *mut pthread_rwlock_t, - __attr: *const pthread_rwlockattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_destroy(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_rdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_tryrdlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedrdlock( - __rwlock: *mut pthread_rwlock_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockrdlock( - __rwlock: *mut pthread_rwlock_t, - __clockid: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_wrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_trywrlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_timedwrlock( - __rwlock: *mut pthread_rwlock_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_clockwrlock( - __rwlock: *mut pthread_rwlock_t, - __clockid: clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlock_unlock(__rwlock: *mut pthread_rwlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_init(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_destroy(__attr: *mut pthread_rwlockattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getpshared( - __attr: *const pthread_rwlockattr_t, - __pshared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setpshared( - __attr: *mut pthread_rwlockattr_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_getkind_np( - __attr: *const pthread_rwlockattr_t, - __pref: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_rwlockattr_setkind_np( - __attr: *mut pthread_rwlockattr_t, - __pref: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_init( - __cond: *mut pthread_cond_t, - __cond_attr: *const pthread_condattr_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_destroy(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_signal(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_broadcast(__cond: *mut pthread_cond_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_wait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_timedwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_cond_clockwait( - __cond: *mut pthread_cond_t, - __mutex: *mut pthread_mutex_t, - __clock_id: __clockid_t, - __abstime: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_init(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_destroy(__attr: *mut pthread_condattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getpshared( - __attr: *const pthread_condattr_t, - __pshared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setpshared( - __attr: *mut pthread_condattr_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_getclock( - __attr: *const pthread_condattr_t, - __clock_id: *mut __clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_condattr_setclock( - __attr: *mut pthread_condattr_t, - __clock_id: __clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_init( - __lock: *mut pthread_spinlock_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_destroy(__lock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_lock(__lock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_trylock(__lock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_spin_unlock(__lock: *mut pthread_spinlock_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_init( - __barrier: *mut pthread_barrier_t, - __attr: *const pthread_barrierattr_t, - __count: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_destroy(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrier_wait(__barrier: *mut pthread_barrier_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_init(__attr: *mut pthread_barrierattr_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_destroy(__attr: *mut pthread_barrierattr_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_getpshared( - __attr: *const pthread_barrierattr_t, - __pshared: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_barrierattr_setpshared( - __attr: *mut pthread_barrierattr_t, - __pshared: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_create( - __key: *mut pthread_key_t, - __destr_function: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void), - >, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_key_delete(__key: pthread_key_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getspecific(__key: pthread_key_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn pthread_setspecific( - __key: pthread_key_t, - __pointer: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_getcpuclockid( - __thread_id: pthread_t, - __clock_id: *mut __clockid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pthread_atfork( - __prepare: ::std::option::Option, - __parent: ::std::option::Option, - __child: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -pub const Allocator_AllocatorDefault: Allocator = 0; -pub const Allocator_AllocatorImmortal: Allocator = 1; -pub const Allocator_AllocatorLos: Allocator = 2; -pub const Allocator_AllocatorCode: Allocator = 3; -pub const Allocator_AllocatorReadOnly: Allocator = 4; -pub type Allocator = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RustDynPtr { - pub data: *mut ::std::os::raw::c_void, - pub vtable: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of RustDynPtr"][::std::mem::size_of::() - 16usize]; - ["Alignment of RustDynPtr"][::std::mem::align_of::() - 8usize]; - ["Offset of field: RustDynPtr::data"][::std::mem::offset_of!(RustDynPtr, data) - 0usize]; - ["Offset of field: RustDynPtr::vtable"][::std::mem::offset_of!(RustDynPtr, vtable) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BumpAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub cursor: *mut ::std::os::raw::c_void, - pub limit: *mut ::std::os::raw::c_void, - pub space: RustDynPtr, - pub context: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of BumpAllocator"][::std::mem::size_of::() - 48usize]; - ["Alignment of BumpAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: BumpAllocator::tls"][::std::mem::offset_of!(BumpAllocator, tls) - 0usize]; - ["Offset of field: BumpAllocator::cursor"] - [::std::mem::offset_of!(BumpAllocator, cursor) - 8usize]; - ["Offset of field: BumpAllocator::limit"] - [::std::mem::offset_of!(BumpAllocator, limit) - 16usize]; - ["Offset of field: BumpAllocator::space"] - [::std::mem::offset_of!(BumpAllocator, space) - 24usize]; - ["Offset of field: BumpAllocator::context"] - [::std::mem::offset_of!(BumpAllocator, context) - 40usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct LargeObjectAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub space: *mut ::std::os::raw::c_void, - pub context: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of LargeObjectAllocator"][::std::mem::size_of::() - 24usize]; - ["Alignment of LargeObjectAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: LargeObjectAllocator::tls"] - [::std::mem::offset_of!(LargeObjectAllocator, tls) - 0usize]; - ["Offset of field: LargeObjectAllocator::space"] - [::std::mem::offset_of!(LargeObjectAllocator, space) - 8usize]; - ["Offset of field: LargeObjectAllocator::context"] - [::std::mem::offset_of!(LargeObjectAllocator, context) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ImmixAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub cursor: *mut ::std::os::raw::c_void, - pub limit: *mut ::std::os::raw::c_void, - pub immix_space: *mut ::std::os::raw::c_void, - pub context: *mut ::std::os::raw::c_void, - pub hot: u8, - pub copy: u8, - pub large_cursor: *mut ::std::os::raw::c_void, - pub large_limit: *mut ::std::os::raw::c_void, - pub request_for_large: u8, - pub _align: [u8; 7usize], - pub line_opt_tag: u8, - pub line_opt: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of ImmixAllocator"][::std::mem::size_of::() - 88usize]; - ["Alignment of ImmixAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: ImmixAllocator::tls"][::std::mem::offset_of!(ImmixAllocator, tls) - 0usize]; - ["Offset of field: ImmixAllocator::cursor"] - [::std::mem::offset_of!(ImmixAllocator, cursor) - 8usize]; - ["Offset of field: ImmixAllocator::limit"] - [::std::mem::offset_of!(ImmixAllocator, limit) - 16usize]; - ["Offset of field: ImmixAllocator::immix_space"] - [::std::mem::offset_of!(ImmixAllocator, immix_space) - 24usize]; - ["Offset of field: ImmixAllocator::context"] - [::std::mem::offset_of!(ImmixAllocator, context) - 32usize]; - ["Offset of field: ImmixAllocator::hot"][::std::mem::offset_of!(ImmixAllocator, hot) - 40usize]; - ["Offset of field: ImmixAllocator::copy"] - [::std::mem::offset_of!(ImmixAllocator, copy) - 41usize]; - ["Offset of field: ImmixAllocator::large_cursor"] - [::std::mem::offset_of!(ImmixAllocator, large_cursor) - 48usize]; - ["Offset of field: ImmixAllocator::large_limit"] - [::std::mem::offset_of!(ImmixAllocator, large_limit) - 56usize]; - ["Offset of field: ImmixAllocator::request_for_large"] - [::std::mem::offset_of!(ImmixAllocator, request_for_large) - 64usize]; - ["Offset of field: ImmixAllocator::_align"] - [::std::mem::offset_of!(ImmixAllocator, _align) - 65usize]; - ["Offset of field: ImmixAllocator::line_opt_tag"] - [::std::mem::offset_of!(ImmixAllocator, line_opt_tag) - 72usize]; - ["Offset of field: ImmixAllocator::line_opt"] - [::std::mem::offset_of!(ImmixAllocator, line_opt) - 80usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FLBlock { - pub Address: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of FLBlock"][::std::mem::size_of::() - 8usize]; - ["Alignment of FLBlock"][::std::mem::align_of::() - 8usize]; - ["Offset of field: FLBlock::Address"][::std::mem::offset_of!(FLBlock, Address) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FLBlockList { - pub first: FLBlock, - pub last: FLBlock, - pub size: usize, - pub lock: ::std::os::raw::c_char, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of FLBlockList"][::std::mem::size_of::() - 32usize]; - ["Alignment of FLBlockList"][::std::mem::align_of::() - 8usize]; - ["Offset of field: FLBlockList::first"][::std::mem::offset_of!(FLBlockList, first) - 0usize]; - ["Offset of field: FLBlockList::last"][::std::mem::offset_of!(FLBlockList, last) - 8usize]; - ["Offset of field: FLBlockList::size"][::std::mem::offset_of!(FLBlockList, size) - 16usize]; - ["Offset of field: FLBlockList::lock"][::std::mem::offset_of!(FLBlockList, lock) - 24usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FreeListAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub space: *mut ::std::os::raw::c_void, - pub context: *mut ::std::os::raw::c_void, - pub available_blocks: *mut FLBlockList, - pub available_blocks_stress: *mut FLBlockList, - pub unswept_blocks: *mut FLBlockList, - pub consumed_blocks: *mut FLBlockList, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of FreeListAllocator"][::std::mem::size_of::() - 56usize]; - ["Alignment of FreeListAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: FreeListAllocator::tls"] - [::std::mem::offset_of!(FreeListAllocator, tls) - 0usize]; - ["Offset of field: FreeListAllocator::space"] - [::std::mem::offset_of!(FreeListAllocator, space) - 8usize]; - ["Offset of field: FreeListAllocator::context"] - [::std::mem::offset_of!(FreeListAllocator, context) - 16usize]; - ["Offset of field: FreeListAllocator::available_blocks"] - [::std::mem::offset_of!(FreeListAllocator, available_blocks) - 24usize]; - ["Offset of field: FreeListAllocator::available_blocks_stress"] - [::std::mem::offset_of!(FreeListAllocator, available_blocks_stress) - 32usize]; - ["Offset of field: FreeListAllocator::unswept_blocks"] - [::std::mem::offset_of!(FreeListAllocator, unswept_blocks) - 40usize]; - ["Offset of field: FreeListAllocator::consumed_blocks"] - [::std::mem::offset_of!(FreeListAllocator, consumed_blocks) - 48usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MMTkMallocAllocator { - pub tls: *mut ::std::os::raw::c_void, - pub space: *mut ::std::os::raw::c_void, - pub context: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of MMTkMallocAllocator"][::std::mem::size_of::() - 24usize]; - ["Alignment of MMTkMallocAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: MMTkMallocAllocator::tls"] - [::std::mem::offset_of!(MMTkMallocAllocator, tls) - 0usize]; - ["Offset of field: MMTkMallocAllocator::space"] - [::std::mem::offset_of!(MMTkMallocAllocator, space) - 8usize]; - ["Offset of field: MMTkMallocAllocator::context"] - [::std::mem::offset_of!(MMTkMallocAllocator, context) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MarkCompactAllocator { - pub bump_allocator: BumpAllocator, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of MarkCompactAllocator"][::std::mem::size_of::() - 48usize]; - ["Alignment of MarkCompactAllocator"][::std::mem::align_of::() - 8usize]; - ["Offset of field: MarkCompactAllocator::bump_allocator"] - [::std::mem::offset_of!(MarkCompactAllocator, bump_allocator) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Allocators { - pub bump_pointer: [BumpAllocator; 6usize], - pub large_object: [LargeObjectAllocator; 2usize], - pub malloc: [MMTkMallocAllocator; 1usize], - pub immix: [ImmixAllocator; 1usize], - pub free_list: [FreeListAllocator; 2usize], - pub markcompact: [MarkCompactAllocator; 1usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of Allocators"][::std::mem::size_of::() - 608usize]; - ["Alignment of Allocators"][::std::mem::align_of::() - 8usize]; - ["Offset of field: Allocators::bump_pointer"] - [::std::mem::offset_of!(Allocators, bump_pointer) - 0usize]; - ["Offset of field: Allocators::large_object"] - [::std::mem::offset_of!(Allocators, large_object) - 288usize]; - ["Offset of field: Allocators::malloc"][::std::mem::offset_of!(Allocators, malloc) - 336usize]; - ["Offset of field: Allocators::immix"][::std::mem::offset_of!(Allocators, immix) - 360usize]; - ["Offset of field: Allocators::free_list"] - [::std::mem::offset_of!(Allocators, free_list) - 448usize]; - ["Offset of field: Allocators::markcompact"] - [::std::mem::offset_of!(Allocators, markcompact) - 560usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MutatorConfig { - pub allocator_mapping: *mut ::std::os::raw::c_void, - pub space_mapping: *mut ::std::os::raw::c_void, - pub prepare_func: RustDynPtr, - pub release_func: RustDynPtr, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of MutatorConfig"][::std::mem::size_of::() - 48usize]; - ["Alignment of MutatorConfig"][::std::mem::align_of::() - 8usize]; - ["Offset of field: MutatorConfig::allocator_mapping"] - [::std::mem::offset_of!(MutatorConfig, allocator_mapping) - 0usize]; - ["Offset of field: MutatorConfig::space_mapping"] - [::std::mem::offset_of!(MutatorConfig, space_mapping) - 8usize]; - ["Offset of field: MutatorConfig::prepare_func"] - [::std::mem::offset_of!(MutatorConfig, prepare_func) - 16usize]; - ["Offset of field: MutatorConfig::release_func"] - [::std::mem::offset_of!(MutatorConfig, release_func) - 32usize]; -}; -#[repr(C)] -#[repr(align(8))] -pub struct MMTkMutatorContext { - pub _bindgen_opaque_blob: [u64; 87usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of MMTkMutatorContext"][::std::mem::size_of::() - 696usize]; - ["Alignment of MMTkMutatorContext"][::std::mem::align_of::() - 8usize]; -}; -pub type sig_atomic_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_taggedvalue_bits { - pub _bitfield_align_1: [u64; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_taggedvalue_bits"] - [::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk__jl_taggedvalue_bits"] - [::std::mem::align_of::() - 8usize]; -}; -impl mmtk__jl_taggedvalue_bits { +impl _jl_taggedvalue_bits { #[inline] pub fn gc(&self) -> usize { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u64) } @@ -2440,246 +723,165 @@ impl mmtk__jl_taggedvalue_bits { } } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_value_t { - _unused: [u8; 0], -} -pub type mmtk_jl_value_t = mmtk__jl_value_t; -pub type mmtk_jl_taggedvalue_t = mmtk__jl_taggedvalue_t; -#[repr(C)] #[derive(Copy, Clone)] -pub struct mmtk__jl_taggedvalue_t { - pub __bindgen_anon_1: mmtk__jl_taggedvalue_t__bindgen_ty_1, +pub struct _jl_taggedvalue_t { + pub __bindgen_anon_1: _jl_taggedvalue_t__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] -pub union mmtk__jl_taggedvalue_t__bindgen_ty_1 { +pub union _jl_taggedvalue_t__bindgen_ty_1 { pub header: usize, - pub next: *mut mmtk_jl_taggedvalue_t, - pub type_: *mut mmtk_jl_value_t, - pub bits: mmtk__jl_taggedvalue_bits, + pub next: *mut jl_taggedvalue_t, + pub type_: *mut jl_value_t, + pub bits: _jl_taggedvalue_bits, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of mmtk__jl_taggedvalue_t__bindgen_ty_1"] - [::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk__jl_taggedvalue_t__bindgen_ty_1"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_taggedvalue_t__bindgen_ty_1::header"] - [::std::mem::offset_of!(mmtk__jl_taggedvalue_t__bindgen_ty_1, header) - 0usize]; - ["Offset of field: mmtk__jl_taggedvalue_t__bindgen_ty_1::next"] - [::std::mem::offset_of!(mmtk__jl_taggedvalue_t__bindgen_ty_1, next) - 0usize]; - ["Offset of field: mmtk__jl_taggedvalue_t__bindgen_ty_1::type_"] - [::std::mem::offset_of!(mmtk__jl_taggedvalue_t__bindgen_ty_1, type_) - 0usize]; - ["Offset of field: mmtk__jl_taggedvalue_t__bindgen_ty_1::bits"] - [::std::mem::offset_of!(mmtk__jl_taggedvalue_t__bindgen_ty_1, bits) - 0usize]; + ["Size of _jl_taggedvalue_t__bindgen_ty_1"] + [::std::mem::size_of::<_jl_taggedvalue_t__bindgen_ty_1>() - 8usize]; + ["Alignment of _jl_taggedvalue_t__bindgen_ty_1"] + [::std::mem::align_of::<_jl_taggedvalue_t__bindgen_ty_1>() - 8usize]; + ["Offset of field: _jl_taggedvalue_t__bindgen_ty_1::header"] + [::std::mem::offset_of!(_jl_taggedvalue_t__bindgen_ty_1, header) - 0usize]; + ["Offset of field: _jl_taggedvalue_t__bindgen_ty_1::next"] + [::std::mem::offset_of!(_jl_taggedvalue_t__bindgen_ty_1, next) - 0usize]; + ["Offset of field: _jl_taggedvalue_t__bindgen_ty_1::type_"] + [::std::mem::offset_of!(_jl_taggedvalue_t__bindgen_ty_1, type_) - 0usize]; + ["Offset of field: _jl_taggedvalue_t__bindgen_ty_1::bits"] + [::std::mem::offset_of!(_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]; + ["Size of _jl_taggedvalue_t"][::std::mem::size_of::<_jl_taggedvalue_t>() - 8usize]; + ["Alignment of _jl_taggedvalue_t"][::std::mem::align_of::<_jl_taggedvalue_t>() - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_datatype_layout_t { - pub size: u32, - pub nfields: u32, - pub npointers: u32, - pub first_ptr: i32, - pub alignment: u16, - pub flags: mmtk_jl_datatype_layout_t__bindgen_ty_1, +pub struct _jl_sym_t { + pub left: u64, + pub right: u64, + pub hash: usize, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _jl_sym_t"][::std::mem::size_of::<_jl_sym_t>() - 24usize]; + ["Alignment of _jl_sym_t"][::std::mem::align_of::<_jl_sym_t>() - 8usize]; + ["Offset of field: _jl_sym_t::left"][::std::mem::offset_of!(_jl_sym_t, left) - 0usize]; + ["Offset of field: _jl_sym_t::right"][::std::mem::offset_of!(_jl_sym_t, right) - 8usize]; + ["Offset of field: _jl_sym_t::hash"][::std::mem::offset_of!(_jl_sym_t, hash) - 16usize]; +}; +pub type jl_sym_t = _jl_sym_t; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_datatype_layout_t__bindgen_ty_1 { - pub _bitfield_align_1: [u16; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, +pub struct jl_svec_t { + pub length: usize, } #[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]; + ["Size of jl_svec_t"][::std::mem::size_of::() - 8usize]; + ["Alignment of jl_svec_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_svec_t::length"][::std::mem::offset_of!(jl_svec_t, length) - 0usize]; }; -impl mmtk_jl_datatype_layout_t__bindgen_ty_1 { - #[inline] - pub fn haspadding(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } - } - #[inline] - pub fn set_haspadding(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn fielddesc_type(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 2u8) as u16) } - } - #[inline] - pub fn set_fielddesc_type(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 2u8, val as u64) - } - } - #[inline] - pub fn arrayelem_isboxed(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } - } - #[inline] - pub fn set_arrayelem_isboxed(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn arrayelem_isunion(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } - } - #[inline] - pub fn set_arrayelem_isunion(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn isbitsegal(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } - } - #[inline] - pub fn set_isbitsegal(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn padding(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 10u8) as u16) } - } - #[inline] - pub fn set_padding(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 10u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - haspadding: u16, - fielddesc_type: u16, - arrayelem_isboxed: u16, - arrayelem_isunion: u16, - isbitsegal: u16, - padding: u16, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let haspadding: u16 = unsafe { ::std::mem::transmute(haspadding) }; - haspadding as u64 - }); - __bindgen_bitfield_unit.set(1usize, 2u8, { - let fielddesc_type: u16 = unsafe { ::std::mem::transmute(fielddesc_type) }; - fielddesc_type as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let arrayelem_isboxed: u16 = unsafe { ::std::mem::transmute(arrayelem_isboxed) }; - arrayelem_isboxed as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let arrayelem_isunion: u16 = unsafe { ::std::mem::transmute(arrayelem_isunion) }; - arrayelem_isunion as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let isbitsegal: u16 = unsafe { ::std::mem::transmute(isbitsegal) }; - isbitsegal as u64 - }); - __bindgen_bitfield_unit.set(6usize, 10u8, { - let padding: u16 = unsafe { ::std::mem::transmute(padding) }; - padding as u64 - }); - __bindgen_bitfield_unit - } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct jl_genericmemory_t { + pub length: usize, + pub ptr: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of jl_genericmemory_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of jl_genericmemory_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_genericmemory_t::length"] + [::std::mem::offset_of!(jl_genericmemory_t, length) - 0usize]; + ["Offset of field: jl_genericmemory_t::ptr"] + [::std::mem::offset_of!(jl_genericmemory_t, ptr) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct jl_genericmemoryref_t { + pub ptr_or_offset: *mut ::std::os::raw::c_void, + pub mem: *mut jl_genericmemory_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of jl_genericmemoryref_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of jl_genericmemoryref_t"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_genericmemoryref_t::ptr_or_offset"] + [::std::mem::offset_of!(jl_genericmemoryref_t, ptr_or_offset) - 0usize]; + ["Offset of field: jl_genericmemoryref_t::mem"] + [::std::mem::offset_of!(jl_genericmemoryref_t, mem) - 8usize]; +}; +#[repr(C)] +#[derive(Debug)] +pub struct jl_array_t { + pub ref_: jl_genericmemoryref_t, + pub dimsize: __IncompleteArrayField, } #[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]; + ["Size of jl_array_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of jl_array_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_array_t::ref_"][::std::mem::offset_of!(jl_array_t, ref_) - 0usize]; + ["Offset of field: jl_array_t::dimsize"][::std::mem::offset_of!(jl_array_t, dimsize) - 16usize]; }; +pub type jl_typemap_t = jl_value_t; +pub type jl_function_t = jl_value_t; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_typename_t { - pub name: *mut ::std::os::raw::c_void, - pub module: *mut mmtk__jl_module_t, - pub names: *mut ::std::os::raw::c_void, +pub struct jl_typename_t { + pub name: *mut jl_sym_t, + pub module: *mut _jl_module_t, + pub names: *mut jl_svec_t, pub atomicfields: *const u32, pub constfields: *const u32, - pub wrapper: *mut ::std::os::raw::c_void, - pub Typeofwrapper: *mut ::std::os::raw::c_void, - pub cache: *mut ::std::os::raw::c_void, - pub linearcache: *mut ::std::os::raw::c_void, - pub mt: *mut ::std::os::raw::c_void, - pub partial: *mut ::std::os::raw::c_void, + pub wrapper: *mut jl_value_t, + pub Typeofwrapper: u64, + pub cache: u64, + pub linearcache: u64, + pub mt: *mut _jl_methtable_t, + pub partial: *mut jl_array_t, pub hash: isize, pub n_uninitialized: i32, pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub max_methods: u8, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_typename_t"][::std::mem::size_of::() - 104usize]; - ["Alignment of mmtk_jl_typename_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_typename_t::name"] - [::std::mem::offset_of!(mmtk_jl_typename_t, name) - 0usize]; - ["Offset of field: mmtk_jl_typename_t::module"] - [::std::mem::offset_of!(mmtk_jl_typename_t, module) - 8usize]; - ["Offset of field: mmtk_jl_typename_t::names"] - [::std::mem::offset_of!(mmtk_jl_typename_t, names) - 16usize]; - ["Offset of field: mmtk_jl_typename_t::atomicfields"] - [::std::mem::offset_of!(mmtk_jl_typename_t, atomicfields) - 24usize]; - ["Offset of field: mmtk_jl_typename_t::constfields"] - [::std::mem::offset_of!(mmtk_jl_typename_t, constfields) - 32usize]; - ["Offset of field: mmtk_jl_typename_t::wrapper"] - [::std::mem::offset_of!(mmtk_jl_typename_t, wrapper) - 40usize]; - ["Offset of field: mmtk_jl_typename_t::Typeofwrapper"] - [::std::mem::offset_of!(mmtk_jl_typename_t, Typeofwrapper) - 48usize]; - ["Offset of field: mmtk_jl_typename_t::cache"] - [::std::mem::offset_of!(mmtk_jl_typename_t, cache) - 56usize]; - ["Offset of field: mmtk_jl_typename_t::linearcache"] - [::std::mem::offset_of!(mmtk_jl_typename_t, linearcache) - 64usize]; - ["Offset of field: mmtk_jl_typename_t::mt"] - [::std::mem::offset_of!(mmtk_jl_typename_t, mt) - 72usize]; - ["Offset of field: mmtk_jl_typename_t::partial"] - [::std::mem::offset_of!(mmtk_jl_typename_t, partial) - 80usize]; - ["Offset of field: mmtk_jl_typename_t::hash"] - [::std::mem::offset_of!(mmtk_jl_typename_t, hash) - 88usize]; - ["Offset of field: mmtk_jl_typename_t::n_uninitialized"] - [::std::mem::offset_of!(mmtk_jl_typename_t, n_uninitialized) - 96usize]; - ["Offset of field: mmtk_jl_typename_t::max_methods"] - [::std::mem::offset_of!(mmtk_jl_typename_t, max_methods) - 101usize]; -}; -impl mmtk_jl_typename_t { + pub constprop_heustic: u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of jl_typename_t"][::std::mem::size_of::() - 104usize]; + ["Alignment of jl_typename_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_typename_t::name"][::std::mem::offset_of!(jl_typename_t, name) - 0usize]; + ["Offset of field: jl_typename_t::module"] + [::std::mem::offset_of!(jl_typename_t, module) - 8usize]; + ["Offset of field: jl_typename_t::names"] + [::std::mem::offset_of!(jl_typename_t, names) - 16usize]; + ["Offset of field: jl_typename_t::atomicfields"] + [::std::mem::offset_of!(jl_typename_t, atomicfields) - 24usize]; + ["Offset of field: jl_typename_t::constfields"] + [::std::mem::offset_of!(jl_typename_t, constfields) - 32usize]; + ["Offset of field: jl_typename_t::wrapper"] + [::std::mem::offset_of!(jl_typename_t, wrapper) - 40usize]; + ["Offset of field: jl_typename_t::Typeofwrapper"] + [::std::mem::offset_of!(jl_typename_t, Typeofwrapper) - 48usize]; + ["Offset of field: jl_typename_t::cache"] + [::std::mem::offset_of!(jl_typename_t, cache) - 56usize]; + ["Offset of field: jl_typename_t::linearcache"] + [::std::mem::offset_of!(jl_typename_t, linearcache) - 64usize]; + ["Offset of field: jl_typename_t::mt"][::std::mem::offset_of!(jl_typename_t, mt) - 72usize]; + ["Offset of field: jl_typename_t::partial"] + [::std::mem::offset_of!(jl_typename_t, partial) - 80usize]; + ["Offset of field: jl_typename_t::hash"][::std::mem::offset_of!(jl_typename_t, hash) - 88usize]; + ["Offset of field: jl_typename_t::n_uninitialized"] + [::std::mem::offset_of!(jl_typename_t, n_uninitialized) - 96usize]; + ["Offset of field: jl_typename_t::max_methods"] + [::std::mem::offset_of!(jl_typename_t, max_methods) - 101usize]; + ["Offset of field: jl_typename_t::constprop_heustic"] + [::std::mem::offset_of!(jl_typename_t, constprop_heustic) - 102usize]; +}; +impl jl_typename_t { #[inline] pub fn abstract_(&self) -> u8 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } @@ -2753,1479 +955,866 @@ impl mmtk_jl_typename_t { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_svec_t { - pub length: usize, +pub struct jl_datatype_layout_t { + pub size: u32, + pub nfields: u32, + pub npointers: u32, + pub first_ptr: i32, + pub alignment: u16, + pub flags: jl_datatype_layout_t__bindgen_ty_1, } -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_svec_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk_jl_svec_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_svec_t::length"] - [::std::mem::offset_of!(mmtk_jl_svec_t, length) - 0usize]; -}; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_datatype_t { - pub name: *mut mmtk_jl_typename_t, - pub super_: *mut mmtk__jl_datatype_t, - pub parameters: *mut mmtk_jl_svec_t, - pub types: *mut mmtk_jl_svec_t, - pub instance: *mut mmtk_jl_value_t, - pub layout: *const mmtk_jl_datatype_layout_t, - pub hash: u32, - pub _bitfield_align_1: [u8; 0], +pub struct jl_datatype_layout_t__bindgen_ty_1 { + pub _bitfield_align_1: [u16; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, - pub __bindgen_padding_0: u16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of mmtk__jl_datatype_t"][::std::mem::size_of::() - 56usize]; - ["Alignment of mmtk__jl_datatype_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_datatype_t::name"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, name) - 0usize]; - ["Offset of field: mmtk__jl_datatype_t::super_"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, super_) - 8usize]; - ["Offset of field: mmtk__jl_datatype_t::parameters"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, parameters) - 16usize]; - ["Offset of field: mmtk__jl_datatype_t::types"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, types) - 24usize]; - ["Offset of field: mmtk__jl_datatype_t::instance"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, instance) - 32usize]; - ["Offset of field: mmtk__jl_datatype_t::layout"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, layout) - 40usize]; - ["Offset of field: mmtk__jl_datatype_t::hash"] - [::std::mem::offset_of!(mmtk__jl_datatype_t, hash) - 48usize]; + ["Size of jl_datatype_layout_t__bindgen_ty_1"] + [::std::mem::size_of::() - 2usize]; + ["Alignment of jl_datatype_layout_t__bindgen_ty_1"] + [::std::mem::align_of::() - 2usize]; }; -impl mmtk__jl_datatype_t { +impl jl_datatype_layout_t__bindgen_ty_1 { #[inline] - pub fn hasfreetypevars(&self) -> u16 { + pub fn haspadding(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } } #[inline] - pub fn set_hasfreetypevars(&mut self, val: u16) { + pub fn set_haspadding(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn isconcretetype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } - } - #[inline] - pub fn set_isconcretetype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn isdispatchtuple(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } + pub fn fielddesc_type(&self) -> u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 2u8) as u16) } } #[inline] - pub fn set_isdispatchtuple(&mut self, val: u16) { + pub fn set_fielddesc_type(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) + self._bitfield_1.set(1usize, 2u8, val as u64) } } #[inline] - pub fn isbitstype(&self) -> u16 { + pub fn arrayelem_isboxed(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } } #[inline] - pub fn set_isbitstype(&mut self, val: u16) { + pub fn set_arrayelem_isboxed(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(3usize, 1u8, val as u64) } } #[inline] - pub fn zeroinit(&self) -> u16 { + pub fn arrayelem_isunion(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } } #[inline] - pub fn set_zeroinit(&mut self, val: u16) { + pub fn set_arrayelem_isunion(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(4usize, 1u8, val as u64) } } #[inline] - pub fn has_concrete_subtype(&self) -> u16 { + pub fn isbitsegal(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } } #[inline] - pub fn set_has_concrete_subtype(&mut self, val: u16) { + pub fn set_isbitsegal(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(5usize, 1u8, val as u64) } } #[inline] - pub fn maybe_subtype_of_cache(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) } - } - #[inline] - pub fn set_maybe_subtype_of_cache(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 1u8, val as u64) - } - } - #[inline] - pub fn isprimitivetype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } - } - #[inline] - pub fn set_isprimitivetype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(7usize, 1u8, val as u64) - } - } - #[inline] - pub fn ismutationfree(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) } - } - #[inline] - pub fn set_ismutationfree(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 1u8, val as u64) - } - } - #[inline] - pub fn isidentityfree(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) } - } - #[inline] - pub fn set_isidentityfree(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(9usize, 1u8, val as u64) - } - } - #[inline] - pub fn smalltag(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 6u8) as u16) } - } - #[inline] - pub fn set_smalltag(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(10usize, 6u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - hasfreetypevars: u16, - isconcretetype: u16, - isdispatchtuple: u16, - isbitstype: u16, - zeroinit: u16, - has_concrete_subtype: u16, - maybe_subtype_of_cache: u16, - isprimitivetype: u16, - ismutationfree: u16, - isidentityfree: u16, - smalltag: u16, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let hasfreetypevars: u16 = unsafe { ::std::mem::transmute(hasfreetypevars) }; - hasfreetypevars as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let isconcretetype: u16 = unsafe { ::std::mem::transmute(isconcretetype) }; - isconcretetype as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let isdispatchtuple: u16 = unsafe { ::std::mem::transmute(isdispatchtuple) }; - isdispatchtuple as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let isbitstype: u16 = unsafe { ::std::mem::transmute(isbitstype) }; - isbitstype as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let zeroinit: u16 = unsafe { ::std::mem::transmute(zeroinit) }; - zeroinit as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let has_concrete_subtype: u16 = unsafe { ::std::mem::transmute(has_concrete_subtype) }; - has_concrete_subtype as u64 - }); - __bindgen_bitfield_unit.set(6usize, 1u8, { - let maybe_subtype_of_cache: u16 = - unsafe { ::std::mem::transmute(maybe_subtype_of_cache) }; - maybe_subtype_of_cache as u64 - }); - __bindgen_bitfield_unit.set(7usize, 1u8, { - let isprimitivetype: u16 = unsafe { ::std::mem::transmute(isprimitivetype) }; - isprimitivetype as u64 - }); - __bindgen_bitfield_unit.set(8usize, 1u8, { - let ismutationfree: u16 = unsafe { ::std::mem::transmute(ismutationfree) }; - ismutationfree as u64 - }); - __bindgen_bitfield_unit.set(9usize, 1u8, { - let isidentityfree: u16 = unsafe { ::std::mem::transmute(isidentityfree) }; - isidentityfree as u64 - }); - __bindgen_bitfield_unit.set(10usize, 6u8, { - let smalltag: u16 = unsafe { ::std::mem::transmute(smalltag) }; - smalltag as u64 - }); - __bindgen_bitfield_unit - } -} -pub type mmtk_jl_datatype_t = mmtk__jl_datatype_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_genericmemory_t { - pub length: usize, - pub ptr: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_genericmemory_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_genericmemory_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_genericmemory_t::length"] - [::std::mem::offset_of!(mmtk_jl_genericmemory_t, length) - 0usize]; - ["Offset of field: mmtk_jl_genericmemory_t::ptr"] - [::std::mem::offset_of!(mmtk_jl_genericmemory_t, ptr) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_genericmemoryref_t { - pub ptr_or_offset: *mut ::std::os::raw::c_void, - pub mem: *mut mmtk_jl_genericmemory_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_genericmemoryref_t"] - [::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_genericmemoryref_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_genericmemoryref_t::ptr_or_offset"] - [::std::mem::offset_of!(mmtk_jl_genericmemoryref_t, ptr_or_offset) - 0usize]; - ["Offset of field: mmtk_jl_genericmemoryref_t::mem"] - [::std::mem::offset_of!(mmtk_jl_genericmemoryref_t, mem) - 8usize]; -}; -#[repr(C)] -#[derive(Debug)] -pub struct mmtk_jl_array_t { - pub ref_: mmtk_jl_genericmemoryref_t, - pub dimsize: __IncompleteArrayField, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_array_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_array_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_array_t::ref_"] - [::std::mem::offset_of!(mmtk_jl_array_t, ref_) - 0usize]; - ["Offset of field: mmtk_jl_array_t::dimsize"] - [::std::mem::offset_of!(mmtk_jl_array_t, dimsize) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_sym_t { - pub left: u64, - pub right: u64, - pub hash: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_sym_t"][::std::mem::size_of::() - 24usize]; - ["Alignment of mmtk__jl_sym_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_sym_t::left"] - [::std::mem::offset_of!(mmtk__jl_sym_t, left) - 0usize]; - ["Offset of field: mmtk__jl_sym_t::right"] - [::std::mem::offset_of!(mmtk__jl_sym_t, right) - 8usize]; - ["Offset of field: mmtk__jl_sym_t::hash"] - [::std::mem::offset_of!(mmtk__jl_sym_t, hash) - 16usize]; -}; -pub type mmtk_jl_sym_t = mmtk__jl_sym_t; -pub type mmtk_jl_ptr_kind_union_t = usize; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_binding_partition_t { - pub restriction: u64, - pub min_world: usize, - pub max_world: u64, - pub next: u64, - pub reserved: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_binding_partition_t"] - [::std::mem::size_of::() - 40usize]; - ["Alignment of mmtk__jl_binding_partition_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_binding_partition_t::restriction"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, restriction) - 0usize]; - ["Offset of field: mmtk__jl_binding_partition_t::min_world"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, min_world) - 8usize]; - ["Offset of field: mmtk__jl_binding_partition_t::max_world"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, max_world) - 16usize]; - ["Offset of field: mmtk__jl_binding_partition_t::next"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, next) - 24usize]; - ["Offset of field: mmtk__jl_binding_partition_t::reserved"] - [::std::mem::offset_of!(mmtk__jl_binding_partition_t, reserved) - 32usize]; -}; -pub type mmtk_jl_binding_partition_t = mmtk__jl_binding_partition_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_binding_t { - pub globalref: *mut ::std::os::raw::c_void, - pub value: u64, - pub partitions: u64, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - pub __bindgen_padding_0: [u8; 7usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_binding_t"][::std::mem::size_of::() - 32usize]; - ["Alignment of mmtk_jl_binding_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_binding_t::globalref"] - [::std::mem::offset_of!(mmtk_jl_binding_t, globalref) - 0usize]; - ["Offset of field: mmtk_jl_binding_t::value"] - [::std::mem::offset_of!(mmtk_jl_binding_t, value) - 8usize]; - ["Offset of field: mmtk_jl_binding_t::partitions"] - [::std::mem::offset_of!(mmtk_jl_binding_t, partitions) - 16usize]; -}; -impl mmtk_jl_binding_t { - #[inline] - pub fn declared(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } - } - #[inline] - pub fn set_declared(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn exportp(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } - } - #[inline] - pub fn set_exportp(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn publicp(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } - } - #[inline] - pub fn set_publicp(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn deprecated(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 2u8) as u8) } - } - #[inline] - pub fn set_deprecated(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 2u8, val as u64) - } - } - #[inline] - pub fn padding(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u8) } - } - #[inline] - pub fn set_padding(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 3u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - declared: u8, - exportp: u8, - publicp: u8, - deprecated: u8, - padding: u8, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let declared: u8 = unsafe { ::std::mem::transmute(declared) }; - declared as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let exportp: u8 = unsafe { ::std::mem::transmute(exportp) }; - exportp as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let publicp: u8 = unsafe { ::std::mem::transmute(publicp) }; - publicp as u64 - }); - __bindgen_bitfield_unit.set(3usize, 2u8, { - let deprecated: u8 = unsafe { ::std::mem::transmute(deprecated) }; - deprecated as u64 - }); - __bindgen_bitfield_unit.set(5usize, 3u8, { - let padding: u8 = unsafe { ::std::mem::transmute(padding) }; - padding as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_htable_t { - pub size: usize, - pub table: *mut *mut ::std::os::raw::c_void, - pub _space: [*mut ::std::os::raw::c_void; 32usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_htable_t"][::std::mem::size_of::() - 272usize]; - ["Alignment of mmtk_htable_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_htable_t::size"][::std::mem::offset_of!(mmtk_htable_t, size) - 0usize]; - ["Offset of field: mmtk_htable_t::table"] - [::std::mem::offset_of!(mmtk_htable_t, table) - 8usize]; - ["Offset of field: mmtk_htable_t::_space"] - [::std::mem::offset_of!(mmtk_htable_t, _space) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_arraylist_t { - pub len: usize, - pub max: usize, - pub items: *mut *mut ::std::os::raw::c_void, - pub _space: [*mut ::std::os::raw::c_void; 29usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_arraylist_t"][::std::mem::size_of::() - 256usize]; - ["Alignment of mmtk_arraylist_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_arraylist_t::len"] - [::std::mem::offset_of!(mmtk_arraylist_t, len) - 0usize]; - ["Offset of field: mmtk_arraylist_t::max"] - [::std::mem::offset_of!(mmtk_arraylist_t, max) - 8usize]; - ["Offset of field: mmtk_arraylist_t::items"] - [::std::mem::offset_of!(mmtk_arraylist_t, items) - 16usize]; - ["Offset of field: mmtk_arraylist_t::_space"] - [::std::mem::offset_of!(mmtk_arraylist_t, _space) - 24usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_small_arraylist_t { - pub len: u32, - pub max: u32, - pub items: *mut *mut ::std::os::raw::c_void, - pub _space: [*mut ::std::os::raw::c_void; 6usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_small_arraylist_t"][::std::mem::size_of::() - 64usize]; - ["Alignment of mmtk_small_arraylist_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_small_arraylist_t::len"] - [::std::mem::offset_of!(mmtk_small_arraylist_t, len) - 0usize]; - ["Offset of field: mmtk_small_arraylist_t::max"] - [::std::mem::offset_of!(mmtk_small_arraylist_t, max) - 4usize]; - ["Offset of field: mmtk_small_arraylist_t::items"] - [::std::mem::offset_of!(mmtk_small_arraylist_t, items) - 8usize]; - ["Offset of field: mmtk_small_arraylist_t::_space"] - [::std::mem::offset_of!(mmtk_small_arraylist_t, _space) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_uuid_t { - pub hi: u64, - pub lo: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_uuid_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_uuid_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_uuid_t::hi"][::std::mem::offset_of!(mmtk_jl_uuid_t, hi) - 0usize]; - ["Offset of field: mmtk_jl_uuid_t::lo"][::std::mem::offset_of!(mmtk_jl_uuid_t, lo) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_mutex_t { - pub owner: u64, - pub count: u32, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_mutex_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk_jl_mutex_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_mutex_t::owner"] - [::std::mem::offset_of!(mmtk_jl_mutex_t, owner) - 0usize]; - ["Offset of field: mmtk_jl_mutex_t::count"] - [::std::mem::offset_of!(mmtk_jl_mutex_t, count) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_module_t { - pub name: *mut ::std::os::raw::c_void, - pub parent: *mut mmtk__jl_module_t, - pub bindings: *mut u64, - pub bindingkeyset: *mut u128, - pub file: *mut ::std::os::raw::c_void, - pub line: i32, - pub usings: mmtk_arraylist_t, - pub build_id: mmtk_jl_uuid_t, - pub uuid: mmtk_jl_uuid_t, - pub counter: u32, - pub nospecialize: i32, - pub optlevel: i8, - pub compile: i8, - pub infer: i8, - pub istopmod: u8, - pub max_methods: i8, - pub lock: mmtk_jl_mutex_t, - pub hash: isize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_module_t"][::std::mem::size_of::() - 376usize]; - ["Alignment of mmtk__jl_module_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_module_t::name"] - [::std::mem::offset_of!(mmtk__jl_module_t, name) - 0usize]; - ["Offset of field: mmtk__jl_module_t::parent"] - [::std::mem::offset_of!(mmtk__jl_module_t, parent) - 8usize]; - ["Offset of field: mmtk__jl_module_t::bindings"] - [::std::mem::offset_of!(mmtk__jl_module_t, bindings) - 16usize]; - ["Offset of field: mmtk__jl_module_t::bindingkeyset"] - [::std::mem::offset_of!(mmtk__jl_module_t, bindingkeyset) - 24usize]; - ["Offset of field: mmtk__jl_module_t::file"] - [::std::mem::offset_of!(mmtk__jl_module_t, file) - 32usize]; - ["Offset of field: mmtk__jl_module_t::line"] - [::std::mem::offset_of!(mmtk__jl_module_t, line) - 40usize]; - ["Offset of field: mmtk__jl_module_t::usings"] - [::std::mem::offset_of!(mmtk__jl_module_t, usings) - 48usize]; - ["Offset of field: mmtk__jl_module_t::build_id"] - [::std::mem::offset_of!(mmtk__jl_module_t, build_id) - 304usize]; - ["Offset of field: mmtk__jl_module_t::uuid"] - [::std::mem::offset_of!(mmtk__jl_module_t, uuid) - 320usize]; - ["Offset of field: mmtk__jl_module_t::counter"] - [::std::mem::offset_of!(mmtk__jl_module_t, counter) - 336usize]; - ["Offset of field: mmtk__jl_module_t::nospecialize"] - [::std::mem::offset_of!(mmtk__jl_module_t, nospecialize) - 340usize]; - ["Offset of field: mmtk__jl_module_t::optlevel"] - [::std::mem::offset_of!(mmtk__jl_module_t, optlevel) - 344usize]; - ["Offset of field: mmtk__jl_module_t::compile"] - [::std::mem::offset_of!(mmtk__jl_module_t, compile) - 345usize]; - ["Offset of field: mmtk__jl_module_t::infer"] - [::std::mem::offset_of!(mmtk__jl_module_t, infer) - 346usize]; - ["Offset of field: mmtk__jl_module_t::istopmod"] - [::std::mem::offset_of!(mmtk__jl_module_t, istopmod) - 347usize]; - ["Offset of field: mmtk__jl_module_t::max_methods"] - [::std::mem::offset_of!(mmtk__jl_module_t, max_methods) - 348usize]; - ["Offset of field: mmtk__jl_module_t::lock"] - [::std::mem::offset_of!(mmtk__jl_module_t, lock) - 352usize]; - ["Offset of field: mmtk__jl_module_t::hash"] - [::std::mem::offset_of!(mmtk__jl_module_t, hash) - 368usize]; -}; -pub type mmtk_jl_module_t = mmtk__jl_module_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_excstack_t { - pub top: usize, - pub reserved_size: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_excstack_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk__jl_excstack_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_excstack_t::top"] - [::std::mem::offset_of!(mmtk__jl_excstack_t, top) - 0usize]; - ["Offset of field: mmtk__jl_excstack_t::reserved_size"] - [::std::mem::offset_of!(mmtk__jl_excstack_t, reserved_size) - 8usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct mmtk__jl_bt_element_t { - pub __bindgen_anon_1: mmtk__jl_bt_element_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union mmtk__jl_bt_element_t__bindgen_ty_1 { - pub uintptr: usize, - pub jlvalue: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_bt_element_t__bindgen_ty_1"] - [::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk__jl_bt_element_t__bindgen_ty_1"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_bt_element_t__bindgen_ty_1::uintptr"] - [::std::mem::offset_of!(mmtk__jl_bt_element_t__bindgen_ty_1, uintptr) - 0usize]; - ["Offset of field: mmtk__jl_bt_element_t__bindgen_ty_1::jlvalue"] - [::std::mem::offset_of!(mmtk__jl_bt_element_t__bindgen_ty_1, jlvalue) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_bt_element_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk__jl_bt_element_t"] - [::std::mem::align_of::() - 8usize]; -}; -pub type mmtk_jl_bt_element_t = mmtk__jl_bt_element_t; -pub type mmtk_jl_excstack_t = mmtk__jl_excstack_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_stack_context_t { - pub uc_mcontext: sigjmp_buf, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_stack_context_t"] - [::std::mem::size_of::() - 200usize]; - ["Alignment of mmtk_jl_stack_context_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_stack_context_t::uc_mcontext"] - [::std::mem::offset_of!(mmtk_jl_stack_context_t, uc_mcontext) - 0usize]; -}; -pub type mmtk__jl_ucontext_t = mmtk_jl_stack_context_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct mmtk_jl_ucontext_t { - pub __bindgen_anon_1: mmtk_jl_ucontext_t__bindgen_ty_1, - pub stkbuf: *mut ::std::os::raw::c_void, - pub bufsz: usize, - pub _bitfield_align_1: [u32; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, - pub __bindgen_padding_0: u32, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union mmtk_jl_ucontext_t__bindgen_ty_1 { - pub ctx: *mut mmtk__jl_ucontext_t, - pub copy_ctx: *mut mmtk_jl_stack_context_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_ucontext_t__bindgen_ty_1"] - [::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk_jl_ucontext_t__bindgen_ty_1"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_ucontext_t__bindgen_ty_1::ctx"] - [::std::mem::offset_of!(mmtk_jl_ucontext_t__bindgen_ty_1, ctx) - 0usize]; - ["Offset of field: mmtk_jl_ucontext_t__bindgen_ty_1::copy_ctx"] - [::std::mem::offset_of!(mmtk_jl_ucontext_t__bindgen_ty_1, copy_ctx) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_ucontext_t"][::std::mem::size_of::() - 32usize]; - ["Alignment of mmtk_jl_ucontext_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_ucontext_t::stkbuf"] - [::std::mem::offset_of!(mmtk_jl_ucontext_t, stkbuf) - 8usize]; - ["Offset of field: mmtk_jl_ucontext_t::bufsz"] - [::std::mem::offset_of!(mmtk_jl_ucontext_t, bufsz) - 16usize]; -}; -impl mmtk_jl_ucontext_t { - #[inline] - pub fn copy_stack(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 31u8) as u32) } - } - #[inline] - pub fn set_copy_stack(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 31u8, val as u64) - } - } - #[inline] - pub fn started(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) } - } - #[inline] - pub fn set_started(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(31usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - copy_stack: ::std::os::raw::c_uint, - started: ::std::os::raw::c_uint, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 31u8, { - let copy_stack: u32 = unsafe { ::std::mem::transmute(copy_stack) }; - copy_stack as u64 - }); - __bindgen_bitfield_unit.set(31usize, 1u8, { - let started: u32 = unsafe { ::std::mem::transmute(started) }; - started as u64 - }); - __bindgen_bitfield_unit - } -} -pub type mmtk_jl_gcframe_t = mmtk__jl_gcframe_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk__jl_gcframe_t { - pub nroots: usize, - pub prev: *mut mmtk__jl_gcframe_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_gcframe_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of mmtk__jl_gcframe_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_gcframe_t::nroots"] - [::std::mem::offset_of!(mmtk__jl_gcframe_t, nroots) - 0usize]; - ["Offset of field: mmtk__jl_gcframe_t::prev"] - [::std::mem::offset_of!(mmtk__jl_gcframe_t, prev) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_pool_t { - pub freelist: *mut mmtk_jl_taggedvalue_t, - pub newpages: *mut mmtk_jl_taggedvalue_t, - pub osize: u16, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_pool_t"][::std::mem::size_of::() - 24usize]; - ["Alignment of mmtk_jl_gc_pool_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_pool_t::freelist"] - [::std::mem::offset_of!(mmtk_jl_gc_pool_t, freelist) - 0usize]; - ["Offset of field: mmtk_jl_gc_pool_t::newpages"] - [::std::mem::offset_of!(mmtk_jl_gc_pool_t, newpages) - 8usize]; - ["Offset of field: mmtk_jl_gc_pool_t::osize"] - [::std::mem::offset_of!(mmtk_jl_gc_pool_t, osize) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_thread_gc_num_common_t { - pub allocd: u64, - pub pool_live_bytes: u64, - pub malloc: u64, - pub realloc: u64, - pub poolalloc: u64, - pub bigalloc: u64, - pub free_acc: u64, - pub alloc_acc: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_thread_gc_num_common_t"] - [::std::mem::size_of::() - 64usize]; - ["Alignment of mmtk_jl_thread_gc_num_common_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::allocd"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, allocd) - 0usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::pool_live_bytes"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, pool_live_bytes) - 8usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::malloc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, malloc) - 16usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::realloc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, realloc) - 24usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::poolalloc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, poolalloc) - 32usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::bigalloc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, bigalloc) - 40usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::free_acc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, free_acc) - 48usize]; - ["Offset of field: mmtk_jl_thread_gc_num_common_t::alloc_acc"] - [::std::mem::offset_of!(mmtk_jl_thread_gc_num_common_t, alloc_acc) - 56usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_thread_heap_common_t { - pub weak_refs: mmtk_small_arraylist_t, - pub live_tasks: mmtk_small_arraylist_t, - pub mallocarrays: *mut _mallocmemory_t, - pub mafreelist: *mut _mallocmemory_t, - pub free_stacks: [mmtk_small_arraylist_t; 16usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_thread_heap_common_t"] - [::std::mem::size_of::() - 1168usize]; - ["Alignment of mmtk_jl_thread_heap_common_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::weak_refs"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, weak_refs) - 0usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::live_tasks"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, live_tasks) - 64usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::mallocarrays"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, mallocarrays) - 128usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::mafreelist"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, mafreelist) - 136usize]; - ["Offset of field: mmtk_jl_thread_heap_common_t::free_stacks"] - [::std::mem::offset_of!(mmtk_jl_thread_heap_common_t, free_stacks) - 144usize]; -}; -pub type mmtk_jl_thread_t = pthread_t; -#[repr(C)] -#[repr(align(64))] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_ws_queue_t { - pub top: u64, - pub __bindgen_padding_0: [u64; 7usize], - pub bottom: u64, - pub __bindgen_padding_1: [u64; 7usize], - pub array: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_ws_queue_t"][::std::mem::size_of::() - 192usize]; - ["Alignment of mmtk_ws_queue_t"][::std::mem::align_of::() - 64usize]; - ["Offset of field: mmtk_ws_queue_t::top"] - [::std::mem::offset_of!(mmtk_ws_queue_t, top) - 0usize]; - ["Offset of field: mmtk_ws_queue_t::bottom"] - [::std::mem::offset_of!(mmtk_ws_queue_t, bottom) - 64usize]; - ["Offset of field: mmtk_ws_queue_t::array"] - [::std::mem::offset_of!(mmtk_ws_queue_t, array) - 128usize]; -}; -#[repr(C)] -#[repr(align(64))] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_markqueue_t { - pub chunk_queue: mmtk_ws_queue_t, - pub ptr_queue: mmtk_ws_queue_t, - pub reclaim_set: mmtk_arraylist_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_markqueue_t"][::std::mem::size_of::() - 640usize]; - ["Alignment of mmtk_jl_gc_markqueue_t"] - [::std::mem::align_of::() - 64usize]; - ["Offset of field: mmtk_jl_gc_markqueue_t::chunk_queue"] - [::std::mem::offset_of!(mmtk_jl_gc_markqueue_t, chunk_queue) - 0usize]; - ["Offset of field: mmtk_jl_gc_markqueue_t::ptr_queue"] - [::std::mem::offset_of!(mmtk_jl_gc_markqueue_t, ptr_queue) - 192usize]; - ["Offset of field: mmtk_jl_gc_markqueue_t::reclaim_set"] - [::std::mem::offset_of!(mmtk_jl_gc_markqueue_t, reclaim_set) - 384usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_page_stack_t { - pub bottom: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_page_stack_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of mmtk_jl_gc_page_stack_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_page_stack_t::bottom"] - [::std::mem::offset_of!(mmtk_jl_gc_page_stack_t, bottom) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_mark_cache_t { - pub perm_scanned_bytes: usize, - pub scanned_bytes: usize, - pub nbig_obj: usize, - pub big_obj: [*mut ::std::os::raw::c_void; 1024usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_mark_cache_t"] - [::std::mem::size_of::() - 8216usize]; - ["Alignment of mmtk_jl_gc_mark_cache_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_mark_cache_t::perm_scanned_bytes"] - [::std::mem::offset_of!(mmtk_jl_gc_mark_cache_t, perm_scanned_bytes) - 0usize]; - ["Offset of field: mmtk_jl_gc_mark_cache_t::scanned_bytes"] - [::std::mem::offset_of!(mmtk_jl_gc_mark_cache_t, scanned_bytes) - 8usize]; - ["Offset of field: mmtk_jl_gc_mark_cache_t::nbig_obj"] - [::std::mem::offset_of!(mmtk_jl_gc_mark_cache_t, nbig_obj) - 16usize]; - ["Offset of field: mmtk_jl_gc_mark_cache_t::big_obj"] - [::std::mem::offset_of!(mmtk_jl_gc_mark_cache_t, big_obj) - 24usize]; -}; -#[repr(C)] -pub struct mmtk_jl_gc_tls_states_t { - pub mmtk_mutator: MMTkMutatorContext, - pub malloc_sz_since_last_poll: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_tls_states_t"] - [::std::mem::size_of::() - 704usize]; - ["Alignment of mmtk_jl_gc_tls_states_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_tls_states_t::mmtk_mutator"] - [::std::mem::offset_of!(mmtk_jl_gc_tls_states_t, mmtk_mutator) - 0usize]; - ["Offset of field: mmtk_jl_gc_tls_states_t::malloc_sz_since_last_poll"] - [::std::mem::offset_of!(mmtk_jl_gc_tls_states_t, malloc_sz_since_last_poll) - 696usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_gc_tls_states_common_t { - pub heap: mmtk_jl_thread_heap_common_t, - pub gc_num: mmtk_jl_thread_gc_num_common_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk_jl_gc_tls_states_common_t"] - [::std::mem::size_of::() - 1232usize]; - ["Alignment of mmtk_jl_gc_tls_states_common_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk_jl_gc_tls_states_common_t::heap"] - [::std::mem::offset_of!(mmtk_jl_gc_tls_states_common_t, heap) - 0usize]; - ["Offset of field: mmtk_jl_gc_tls_states_common_t::gc_num"] - [::std::mem::offset_of!(mmtk_jl_gc_tls_states_common_t, gc_num) - 1168usize]; -}; -#[repr(C)] -pub struct mmtk__jl_tls_states_t { - pub tid: i16, - pub threadpoolid: i8, - pub rngseed: u64, - pub safepoint: u64, - pub sleep_check_state: u8, - pub gc_state: u8, - pub in_pure_callback: i16, - pub in_finalizer: i16, - pub disable_gc: i16, - pub finalizers_inhibited: ::std::os::raw::c_int, - pub gc_tls: mmtk_jl_gc_tls_states_t, - pub gc_tls_common: mmtk_jl_gc_tls_states_common_t, - pub defer_signal: sig_atomic_t, - pub current_task: u64, - pub next_task: *mut mmtk__jl_task_t, - pub previous_task: *mut mmtk__jl_task_t, - pub root_task: *mut mmtk__jl_task_t, - pub timing_stack: *mut ::std::os::raw::c_void, - pub stackbase: *mut ::std::os::raw::c_void, - pub stacksize: usize, - pub sig_exception: *mut mmtk_jl_value_t, - pub bt_data: *mut mmtk__jl_bt_element_t, - pub bt_size: usize, - pub profiling_bt_buffer: *mut mmtk__jl_bt_element_t, - pub signal_request: u32, - pub io_wait: sig_atomic_t, - pub signal_stack: *mut ::std::os::raw::c_void, - pub signal_stack_size: usize, - pub system_id: mmtk_jl_thread_t, - pub suspend_count: u16, - pub finalizers: mmtk_arraylist_t, - pub previous_exception: *mut _jl_value_t, - pub locks: mmtk_small_arraylist_t, - pub engine_nqueued: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_tls_states_t"][::std::mem::size_of::() - 2448usize]; - ["Alignment of mmtk__jl_tls_states_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_tls_states_t::tid"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, tid) - 0usize]; - ["Offset of field: mmtk__jl_tls_states_t::threadpoolid"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, threadpoolid) - 2usize]; - ["Offset of field: mmtk__jl_tls_states_t::rngseed"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, rngseed) - 8usize]; - ["Offset of field: mmtk__jl_tls_states_t::safepoint"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, safepoint) - 16usize]; - ["Offset of field: mmtk__jl_tls_states_t::sleep_check_state"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, sleep_check_state) - 24usize]; - ["Offset of field: mmtk__jl_tls_states_t::gc_state"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, gc_state) - 25usize]; - ["Offset of field: mmtk__jl_tls_states_t::in_pure_callback"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, in_pure_callback) - 26usize]; - ["Offset of field: mmtk__jl_tls_states_t::in_finalizer"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, in_finalizer) - 28usize]; - ["Offset of field: mmtk__jl_tls_states_t::disable_gc"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, disable_gc) - 30usize]; - ["Offset of field: mmtk__jl_tls_states_t::finalizers_inhibited"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, finalizers_inhibited) - 32usize]; - ["Offset of field: mmtk__jl_tls_states_t::gc_tls"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, gc_tls) - 40usize]; - ["Offset of field: mmtk__jl_tls_states_t::gc_tls_common"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, gc_tls_common) - 744usize]; - ["Offset of field: mmtk__jl_tls_states_t::defer_signal"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, defer_signal) - 1976usize]; - ["Offset of field: mmtk__jl_tls_states_t::current_task"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, current_task) - 1984usize]; - ["Offset of field: mmtk__jl_tls_states_t::next_task"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, next_task) - 1992usize]; - ["Offset of field: mmtk__jl_tls_states_t::previous_task"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, previous_task) - 2000usize]; - ["Offset of field: mmtk__jl_tls_states_t::root_task"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, root_task) - 2008usize]; - ["Offset of field: mmtk__jl_tls_states_t::timing_stack"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, timing_stack) - 2016usize]; - ["Offset of field: mmtk__jl_tls_states_t::stackbase"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, stackbase) - 2024usize]; - ["Offset of field: mmtk__jl_tls_states_t::stacksize"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, stacksize) - 2032usize]; - ["Offset of field: mmtk__jl_tls_states_t::sig_exception"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, sig_exception) - 2040usize]; - ["Offset of field: mmtk__jl_tls_states_t::bt_data"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, bt_data) - 2048usize]; - ["Offset of field: mmtk__jl_tls_states_t::bt_size"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, bt_size) - 2056usize]; - ["Offset of field: mmtk__jl_tls_states_t::profiling_bt_buffer"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, profiling_bt_buffer) - 2064usize]; - ["Offset of field: mmtk__jl_tls_states_t::signal_request"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, signal_request) - 2072usize]; - ["Offset of field: mmtk__jl_tls_states_t::io_wait"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, io_wait) - 2076usize]; - ["Offset of field: mmtk__jl_tls_states_t::signal_stack"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, signal_stack) - 2080usize]; - ["Offset of field: mmtk__jl_tls_states_t::signal_stack_size"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, signal_stack_size) - 2088usize]; - ["Offset of field: mmtk__jl_tls_states_t::system_id"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, system_id) - 2096usize]; - ["Offset of field: mmtk__jl_tls_states_t::suspend_count"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, suspend_count) - 2104usize]; - ["Offset of field: mmtk__jl_tls_states_t::finalizers"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, finalizers) - 2112usize]; - ["Offset of field: mmtk__jl_tls_states_t::previous_exception"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, previous_exception) - 2368usize]; - ["Offset of field: mmtk__jl_tls_states_t::locks"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, locks) - 2376usize]; - ["Offset of field: mmtk__jl_tls_states_t::engine_nqueued"] - [::std::mem::offset_of!(mmtk__jl_tls_states_t, engine_nqueued) - 2440usize]; -}; -pub type mmtk_jl_tls_states_t = mmtk__jl_tls_states_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct mmtk__jl_task_t { - pub next: *mut ::std::os::raw::c_void, - pub queue: *mut ::std::os::raw::c_void, - pub tls: *mut ::std::os::raw::c_void, - pub donenotify: *mut ::std::os::raw::c_void, - pub result: *mut ::std::os::raw::c_void, - pub scope: *mut ::std::os::raw::c_void, - pub start: *mut ::std::os::raw::c_void, - pub rngState: [u64; 5usize], - pub _state: u8, - pub sticky: u8, - pub _isexception: u8, - pub priority: u16, - pub tid: u16, - pub threadpoolid: i8, - pub reentrant_timing: u8, - pub gcstack: *mut mmtk_jl_gcframe_t, - pub world_age: usize, - pub ptls: *mut ::std::os::raw::c_void, - pub excstack: *mut mmtk_jl_excstack_t, - pub eh: *mut ::std::os::raw::c_void, - pub ctx: mmtk_jl_ucontext_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of mmtk__jl_task_t"][::std::mem::size_of::() - 184usize]; - ["Alignment of mmtk__jl_task_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: mmtk__jl_task_t::next"] - [::std::mem::offset_of!(mmtk__jl_task_t, next) - 0usize]; - ["Offset of field: mmtk__jl_task_t::queue"] - [::std::mem::offset_of!(mmtk__jl_task_t, queue) - 8usize]; - ["Offset of field: mmtk__jl_task_t::tls"] - [::std::mem::offset_of!(mmtk__jl_task_t, tls) - 16usize]; - ["Offset of field: mmtk__jl_task_t::donenotify"] - [::std::mem::offset_of!(mmtk__jl_task_t, donenotify) - 24usize]; - ["Offset of field: mmtk__jl_task_t::result"] - [::std::mem::offset_of!(mmtk__jl_task_t, result) - 32usize]; - ["Offset of field: mmtk__jl_task_t::scope"] - [::std::mem::offset_of!(mmtk__jl_task_t, scope) - 40usize]; - ["Offset of field: mmtk__jl_task_t::start"] - [::std::mem::offset_of!(mmtk__jl_task_t, start) - 48usize]; - ["Offset of field: mmtk__jl_task_t::rngState"] - [::std::mem::offset_of!(mmtk__jl_task_t, rngState) - 56usize]; - ["Offset of field: mmtk__jl_task_t::_state"] - [::std::mem::offset_of!(mmtk__jl_task_t, _state) - 96usize]; - ["Offset of field: mmtk__jl_task_t::sticky"] - [::std::mem::offset_of!(mmtk__jl_task_t, sticky) - 97usize]; - ["Offset of field: mmtk__jl_task_t::_isexception"] - [::std::mem::offset_of!(mmtk__jl_task_t, _isexception) - 98usize]; - ["Offset of field: mmtk__jl_task_t::priority"] - [::std::mem::offset_of!(mmtk__jl_task_t, priority) - 100usize]; - ["Offset of field: mmtk__jl_task_t::tid"] - [::std::mem::offset_of!(mmtk__jl_task_t, tid) - 102usize]; - ["Offset of field: mmtk__jl_task_t::threadpoolid"] - [::std::mem::offset_of!(mmtk__jl_task_t, threadpoolid) - 104usize]; - ["Offset of field: mmtk__jl_task_t::reentrant_timing"] - [::std::mem::offset_of!(mmtk__jl_task_t, reentrant_timing) - 105usize]; - ["Offset of field: mmtk__jl_task_t::gcstack"] - [::std::mem::offset_of!(mmtk__jl_task_t, gcstack) - 112usize]; - ["Offset of field: mmtk__jl_task_t::world_age"] - [::std::mem::offset_of!(mmtk__jl_task_t, world_age) - 120usize]; - ["Offset of field: mmtk__jl_task_t::ptls"] - [::std::mem::offset_of!(mmtk__jl_task_t, ptls) - 128usize]; - ["Offset of field: mmtk__jl_task_t::excstack"] - [::std::mem::offset_of!(mmtk__jl_task_t, excstack) - 136usize]; - ["Offset of field: mmtk__jl_task_t::eh"] - [::std::mem::offset_of!(mmtk__jl_task_t, eh) - 144usize]; - ["Offset of field: mmtk__jl_task_t::ctx"] - [::std::mem::offset_of!(mmtk__jl_task_t, ctx) - 152usize]; -}; -pub type mmtk_jl_task_t = mmtk__jl_task_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmtk_jl_weakref_t { - pub value: *mut mmtk_jl_value_t, + pub fn padding(&self) -> u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 10u8) as u16) } + } + #[inline] + pub fn set_padding(&mut self, val: u16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 10u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + haspadding: u16, + fielddesc_type: u16, + arrayelem_isboxed: u16, + arrayelem_isunion: u16, + isbitsegal: u16, + padding: u16, + ) -> __BindgenBitfieldUnit<[u8; 2usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let haspadding: u16 = unsafe { ::std::mem::transmute(haspadding) }; + haspadding as u64 + }); + __bindgen_bitfield_unit.set(1usize, 2u8, { + let fielddesc_type: u16 = unsafe { ::std::mem::transmute(fielddesc_type) }; + fielddesc_type as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let arrayelem_isboxed: u16 = unsafe { ::std::mem::transmute(arrayelem_isboxed) }; + arrayelem_isboxed as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let arrayelem_isunion: u16 = unsafe { ::std::mem::transmute(arrayelem_isunion) }; + arrayelem_isunion as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let isbitsegal: u16 = unsafe { ::std::mem::transmute(isbitsegal) }; + isbitsegal as u64 + }); + __bindgen_bitfield_unit.set(6usize, 10u8, { + let padding: u16 = unsafe { ::std::mem::transmute(padding) }; + padding as u64 + }); + __bindgen_bitfield_unit + } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of mmtk_jl_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]; + ["Size of jl_datatype_layout_t"][::std::mem::size_of::() - 20usize]; + ["Alignment of jl_datatype_layout_t"][::std::mem::align_of::() - 4usize]; + ["Offset of field: jl_datatype_layout_t::size"] + [::std::mem::offset_of!(jl_datatype_layout_t, size) - 0usize]; + ["Offset of field: jl_datatype_layout_t::nfields"] + [::std::mem::offset_of!(jl_datatype_layout_t, nfields) - 4usize]; + ["Offset of field: jl_datatype_layout_t::npointers"] + [::std::mem::offset_of!(jl_datatype_layout_t, npointers) - 8usize]; + ["Offset of field: jl_datatype_layout_t::first_ptr"] + [::std::mem::offset_of!(jl_datatype_layout_t, first_ptr) - 12usize]; + ["Offset of field: jl_datatype_layout_t::alignment"] + [::std::mem::offset_of!(jl_datatype_layout_t, alignment) - 16usize]; + ["Offset of field: jl_datatype_layout_t::flags"] + [::std::mem::offset_of!(jl_datatype_layout_t, flags) - 18usize]; }; #[repr(C)] -#[derive(Copy, Clone)] -pub union mmtk___jl_purity_overrides_t { - pub overrides: mmtk___jl_purity_overrides_t__bindgen_ty_1, - pub bits: u16, -} -#[repr(C)] -#[repr(align(2))] #[derive(Debug, Copy, Clone)] -pub struct mmtk___jl_purity_overrides_t__bindgen_ty_1 { +pub struct _jl_datatype_t { + pub name: *mut jl_typename_t, + pub super_: *mut _jl_datatype_t, + pub parameters: *mut jl_svec_t, + pub types: *mut jl_svec_t, + pub instance: *mut jl_value_t, + pub layout: *const jl_datatype_layout_t, + pub hash: u32, pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, + pub __bindgen_padding_0: u16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of mmtk___jl_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]; + ["Size of _jl_datatype_t"][::std::mem::size_of::<_jl_datatype_t>() - 56usize]; + ["Alignment of _jl_datatype_t"][::std::mem::align_of::<_jl_datatype_t>() - 8usize]; + ["Offset of field: _jl_datatype_t::name"] + [::std::mem::offset_of!(_jl_datatype_t, name) - 0usize]; + ["Offset of field: _jl_datatype_t::super_"] + [::std::mem::offset_of!(_jl_datatype_t, super_) - 8usize]; + ["Offset of field: _jl_datatype_t::parameters"] + [::std::mem::offset_of!(_jl_datatype_t, parameters) - 16usize]; + ["Offset of field: _jl_datatype_t::types"] + [::std::mem::offset_of!(_jl_datatype_t, types) - 24usize]; + ["Offset of field: _jl_datatype_t::instance"] + [::std::mem::offset_of!(_jl_datatype_t, instance) - 32usize]; + ["Offset of field: _jl_datatype_t::layout"] + [::std::mem::offset_of!(_jl_datatype_t, layout) - 40usize]; + ["Offset of field: _jl_datatype_t::hash"] + [::std::mem::offset_of!(_jl_datatype_t, hash) - 48usize]; }; -impl mmtk___jl_purity_overrides_t__bindgen_ty_1 { +impl _jl_datatype_t { #[inline] - pub fn ipo_consistent(&self) -> u16 { + pub fn hasfreetypevars(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_consistent(&mut self, val: u16) { + pub fn set_hasfreetypevars(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn ipo_effect_free(&self) -> u16 { + pub fn isconcretetype(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_effect_free(&mut self, val: u16) { + pub fn set_isconcretetype(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(1usize, 1u8, val as u64) } } #[inline] - pub fn ipo_nothrow(&self) -> u16 { + pub fn isdispatchtuple(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_nothrow(&mut self, val: u16) { + pub fn set_isdispatchtuple(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(2usize, 1u8, val as u64) } } #[inline] - pub fn ipo_terminates_globally(&self) -> u16 { + pub fn isbitstype(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_terminates_globally(&mut self, val: u16) { + pub fn set_isbitstype(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(3usize, 1u8, val as u64) } } #[inline] - pub fn ipo_terminates_locally(&self) -> u16 { + pub fn zeroinit(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_terminates_locally(&mut self, val: u16) { + pub fn set_zeroinit(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(4usize, 1u8, val as u64) } } #[inline] - pub fn ipo_notaskstate(&self) -> u16 { + pub fn has_concrete_subtype(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_notaskstate(&mut self, val: u16) { + pub fn set_has_concrete_subtype(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(5usize, 1u8, val as u64) } } #[inline] - pub fn ipo_inaccessiblememonly(&self) -> u16 { + pub fn maybe_subtype_of_cache(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_inaccessiblememonly(&mut self, val: u16) { + pub fn set_maybe_subtype_of_cache(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(6usize, 1u8, val as u64) } } #[inline] - pub fn ipo_noub(&self) -> u16 { + pub fn isprimitivetype(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_noub(&mut self, val: u16) { + pub fn set_isprimitivetype(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(7usize, 1u8, val as u64) } } #[inline] - pub fn ipo_noub_if_noinbounds(&self) -> u16 { + pub fn ismutationfree(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_noub_if_noinbounds(&mut self, val: u16) { + pub fn set_ismutationfree(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(8usize, 1u8, val as u64) } } #[inline] - pub fn ipo_consistent_overlay(&self) -> u16 { + pub fn isidentityfree(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) } } #[inline] - pub fn set_ipo_consistent_overlay(&mut self, val: u16) { + pub fn set_isidentityfree(&mut self, val: u16) { unsafe { let val: u16 = ::std::mem::transmute(val); self._bitfield_1.set(9usize, 1u8, val as u64) } } #[inline] + pub fn smalltag(&self) -> u16 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 6u8) as u16) } + } + #[inline] + pub fn set_smalltag(&mut self, val: u16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 6u8, val as u64) + } + } + #[inline] pub fn new_bitfield_1( - ipo_consistent: u16, - ipo_effect_free: u16, - ipo_nothrow: u16, - ipo_terminates_globally: u16, - ipo_terminates_locally: u16, - ipo_notaskstate: u16, - ipo_inaccessiblememonly: u16, - ipo_noub: u16, - ipo_noub_if_noinbounds: u16, - ipo_consistent_overlay: u16, + hasfreetypevars: u16, + isconcretetype: u16, + isdispatchtuple: u16, + isbitstype: u16, + zeroinit: u16, + has_concrete_subtype: u16, + maybe_subtype_of_cache: u16, + isprimitivetype: u16, + ismutationfree: u16, + isidentityfree: u16, + smalltag: u16, ) -> __BindgenBitfieldUnit<[u8; 2usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { - let ipo_consistent: u16 = unsafe { ::std::mem::transmute(ipo_consistent) }; - ipo_consistent as u64 + let hasfreetypevars: u16 = unsafe { ::std::mem::transmute(hasfreetypevars) }; + hasfreetypevars as u64 }); __bindgen_bitfield_unit.set(1usize, 1u8, { - let ipo_effect_free: u16 = unsafe { ::std::mem::transmute(ipo_effect_free) }; - ipo_effect_free as u64 + let isconcretetype: u16 = unsafe { ::std::mem::transmute(isconcretetype) }; + isconcretetype as u64 }); __bindgen_bitfield_unit.set(2usize, 1u8, { - let ipo_nothrow: u16 = unsafe { ::std::mem::transmute(ipo_nothrow) }; - ipo_nothrow as u64 + let isdispatchtuple: u16 = unsafe { ::std::mem::transmute(isdispatchtuple) }; + isdispatchtuple as u64 }); __bindgen_bitfield_unit.set(3usize, 1u8, { - let ipo_terminates_globally: u16 = - unsafe { ::std::mem::transmute(ipo_terminates_globally) }; - ipo_terminates_globally as u64 + let isbitstype: u16 = unsafe { ::std::mem::transmute(isbitstype) }; + isbitstype as u64 }); __bindgen_bitfield_unit.set(4usize, 1u8, { - let ipo_terminates_locally: u16 = - unsafe { ::std::mem::transmute(ipo_terminates_locally) }; - ipo_terminates_locally as u64 + let zeroinit: u16 = unsafe { ::std::mem::transmute(zeroinit) }; + zeroinit as u64 }); __bindgen_bitfield_unit.set(5usize, 1u8, { - let ipo_notaskstate: u16 = unsafe { ::std::mem::transmute(ipo_notaskstate) }; - ipo_notaskstate as u64 + let has_concrete_subtype: u16 = unsafe { ::std::mem::transmute(has_concrete_subtype) }; + has_concrete_subtype as u64 }); __bindgen_bitfield_unit.set(6usize, 1u8, { - let ipo_inaccessiblememonly: u16 = - unsafe { ::std::mem::transmute(ipo_inaccessiblememonly) }; - ipo_inaccessiblememonly as u64 + let maybe_subtype_of_cache: u16 = + unsafe { ::std::mem::transmute(maybe_subtype_of_cache) }; + maybe_subtype_of_cache as u64 }); __bindgen_bitfield_unit.set(7usize, 1u8, { - let ipo_noub: u16 = unsafe { ::std::mem::transmute(ipo_noub) }; - ipo_noub as u64 + let isprimitivetype: u16 = unsafe { ::std::mem::transmute(isprimitivetype) }; + isprimitivetype as u64 }); __bindgen_bitfield_unit.set(8usize, 1u8, { - let ipo_noub_if_noinbounds: u16 = - unsafe { ::std::mem::transmute(ipo_noub_if_noinbounds) }; - ipo_noub_if_noinbounds as u64 + let ismutationfree: u16 = unsafe { ::std::mem::transmute(ismutationfree) }; + ismutationfree as u64 }); __bindgen_bitfield_unit.set(9usize, 1u8, { - let ipo_consistent_overlay: u16 = - unsafe { ::std::mem::transmute(ipo_consistent_overlay) }; - ipo_consistent_overlay as u64 + let isidentityfree: u16 = unsafe { ::std::mem::transmute(isidentityfree) }; + isidentityfree as u64 + }); + __bindgen_bitfield_unit.set(10usize, 6u8, { + let smalltag: u16 = unsafe { ::std::mem::transmute(smalltag) }; + smalltag as u64 }); __bindgen_bitfield_unit } } +pub type jl_datatype_t = _jl_datatype_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _jl_weakref_t { + pub value: *mut jl_value_t, +} #[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]; + ["Size of _jl_weakref_t"][::std::mem::size_of::<_jl_weakref_t>() - 8usize]; + ["Alignment of _jl_weakref_t"][::std::mem::align_of::<_jl_weakref_t>() - 8usize]; + ["Offset of field: _jl_weakref_t::value"] + [::std::mem::offset_of!(_jl_weakref_t, value) - 0usize]; }; -pub type mmtk__jl_purity_overrides_t = mmtk___jl_purity_overrides_t; +pub type jl_weakref_t = _jl_weakref_t; +pub type jl_ptr_kind_union_t = usize; #[repr(C)] -#[derive(Copy, Clone)] -pub struct mmtk__jl_method_t { - pub name: *mut ::std::os::raw::c_void, - pub module: *mut mmtk__jl_module_t, - pub file: *mut ::std::os::raw::c_void, +#[derive(Debug)] +pub struct _jl_binding_partition_t { + pub restriction: std_atomic, + pub min_world: usize, + pub max_world: std_atomic, + pub next: u64, + pub reserved: usize, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _jl_binding_partition_t"][::std::mem::size_of::<_jl_binding_partition_t>() - 40usize]; + ["Alignment of _jl_binding_partition_t"] + [::std::mem::align_of::<_jl_binding_partition_t>() - 8usize]; + ["Offset of field: _jl_binding_partition_t::restriction"] + [::std::mem::offset_of!(_jl_binding_partition_t, restriction) - 0usize]; + ["Offset of field: _jl_binding_partition_t::min_world"] + [::std::mem::offset_of!(_jl_binding_partition_t, min_world) - 8usize]; + ["Offset of field: _jl_binding_partition_t::max_world"] + [::std::mem::offset_of!(_jl_binding_partition_t, max_world) - 16usize]; + ["Offset of field: _jl_binding_partition_t::next"] + [::std::mem::offset_of!(_jl_binding_partition_t, next) - 24usize]; + ["Offset of field: _jl_binding_partition_t::reserved"] + [::std::mem::offset_of!(_jl_binding_partition_t, reserved) - 32usize]; +}; +pub type jl_binding_partition_t = _jl_binding_partition_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct jl_uuid_t { + pub hi: u64, + pub lo: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of jl_uuid_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of jl_uuid_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: jl_uuid_t::hi"][::std::mem::offset_of!(jl_uuid_t, hi) - 0usize]; + ["Offset of field: jl_uuid_t::lo"][::std::mem::offset_of!(jl_uuid_t, lo) - 8usize]; +}; +#[repr(C)] +#[derive(Debug)] +pub struct _jl_module_t { + pub name: *mut jl_sym_t, + pub parent: *mut _jl_module_t, + pub bindings: u64, + pub bindingkeyset: u64, + pub file: *mut jl_sym_t, pub line: i32, - pub primary_world: usize, - pub deleted_world: usize, - pub sig: *mut ::std::os::raw::c_void, - pub specializations: u64, - pub speckeyset: u64, - pub slot_syms: *mut ::std::os::raw::c_void, - pub external_mt: *mut ::std::os::raw::c_void, - pub source: *mut ::std::os::raw::c_void, - pub debuginfo: *mut ::std::os::raw::c_void, - pub unspecialized: u64, - pub generator: *mut ::std::os::raw::c_void, - pub roots: *mut ::std::os::raw::c_void, - pub root_blocks: *mut ::std::os::raw::c_void, - pub nroots_sysimg: i32, - pub ccallable: *mut ::std::os::raw::c_void, - pub invokes: u64, - pub recursion_relation: *mut ::std::os::raw::c_void, - pub nargs: u32, - pub called: u32, - pub nospecialize: u32, - pub nkw: u32, - pub isva: u8, - pub is_for_opaque_closure: u8, - pub nospecializeinfer: u8, - pub constprop: u8, - pub max_varargs: u8, - pub purity: mmtk__jl_purity_overrides_t, - pub writelock: mmtk_jl_mutex_t, + pub usings: arraylist_t, + pub build_id: jl_uuid_t, + pub uuid: jl_uuid_t, + pub counter: std_atomic, + pub nospecialize: i32, + pub optlevel: i8, + pub compile: i8, + pub infer: i8, + pub istopmod: u8, + pub max_methods: i8, + pub lock: jl_mutex_t, + pub hash: isize, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _jl_module_t"][::std::mem::size_of::<_jl_module_t>() - 376usize]; + ["Alignment of _jl_module_t"][::std::mem::align_of::<_jl_module_t>() - 8usize]; + ["Offset of field: _jl_module_t::name"][::std::mem::offset_of!(_jl_module_t, name) - 0usize]; + ["Offset of field: _jl_module_t::parent"] + [::std::mem::offset_of!(_jl_module_t, parent) - 8usize]; + ["Offset of field: _jl_module_t::bindings"] + [::std::mem::offset_of!(_jl_module_t, bindings) - 16usize]; + ["Offset of field: _jl_module_t::bindingkeyset"] + [::std::mem::offset_of!(_jl_module_t, bindingkeyset) - 24usize]; + ["Offset of field: _jl_module_t::file"][::std::mem::offset_of!(_jl_module_t, file) - 32usize]; + ["Offset of field: _jl_module_t::line"][::std::mem::offset_of!(_jl_module_t, line) - 40usize]; + ["Offset of field: _jl_module_t::usings"] + [::std::mem::offset_of!(_jl_module_t, usings) - 48usize]; + ["Offset of field: _jl_module_t::build_id"] + [::std::mem::offset_of!(_jl_module_t, build_id) - 304usize]; + ["Offset of field: _jl_module_t::uuid"][::std::mem::offset_of!(_jl_module_t, uuid) - 320usize]; + ["Offset of field: _jl_module_t::counter"] + [::std::mem::offset_of!(_jl_module_t, counter) - 336usize]; + ["Offset of field: _jl_module_t::nospecialize"] + [::std::mem::offset_of!(_jl_module_t, nospecialize) - 340usize]; + ["Offset of field: _jl_module_t::optlevel"] + [::std::mem::offset_of!(_jl_module_t, optlevel) - 344usize]; + ["Offset of field: _jl_module_t::compile"] + [::std::mem::offset_of!(_jl_module_t, compile) - 345usize]; + ["Offset of field: _jl_module_t::infer"] + [::std::mem::offset_of!(_jl_module_t, infer) - 346usize]; + ["Offset of field: _jl_module_t::istopmod"] + [::std::mem::offset_of!(_jl_module_t, istopmod) - 347usize]; + ["Offset of field: _jl_module_t::max_methods"] + [::std::mem::offset_of!(_jl_module_t, max_methods) - 348usize]; + ["Offset of field: _jl_module_t::lock"][::std::mem::offset_of!(_jl_module_t, lock) - 352usize]; + ["Offset of field: _jl_module_t::hash"][::std::mem::offset_of!(_jl_module_t, hash) - 368usize]; +}; +pub type jl_module_t = _jl_module_t; +#[repr(C)] +#[derive(Debug)] +pub struct _jl_methtable_t { + pub name: *mut jl_sym_t, + pub defs: u64, + pub leafcache: u64, + pub cache: u64, + pub max_args: std_atomic, + pub module: *mut jl_module_t, + pub backedges: *mut jl_array_t, + pub writelock: jl_mutex_t, + pub offs: u8, + pub frozen: u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _jl_methtable_t"][::std::mem::size_of::<_jl_methtable_t>() - 80usize]; + ["Alignment of _jl_methtable_t"][::std::mem::align_of::<_jl_methtable_t>() - 8usize]; + ["Offset of field: _jl_methtable_t::name"] + [::std::mem::offset_of!(_jl_methtable_t, name) - 0usize]; + ["Offset of field: _jl_methtable_t::defs"] + [::std::mem::offset_of!(_jl_methtable_t, defs) - 8usize]; + ["Offset of field: _jl_methtable_t::leafcache"] + [::std::mem::offset_of!(_jl_methtable_t, leafcache) - 16usize]; + ["Offset of field: _jl_methtable_t::cache"] + [::std::mem::offset_of!(_jl_methtable_t, cache) - 24usize]; + ["Offset of field: _jl_methtable_t::max_args"] + [::std::mem::offset_of!(_jl_methtable_t, max_args) - 32usize]; + ["Offset of field: _jl_methtable_t::module"] + [::std::mem::offset_of!(_jl_methtable_t, module) - 40usize]; + ["Offset of field: _jl_methtable_t::backedges"] + [::std::mem::offset_of!(_jl_methtable_t, backedges) - 48usize]; + ["Offset of field: _jl_methtable_t::writelock"] + [::std::mem::offset_of!(_jl_methtable_t, writelock) - 56usize]; + ["Offset of field: _jl_methtable_t::offs"] + [::std::mem::offset_of!(_jl_methtable_t, offs) - 72usize]; + ["Offset of field: _jl_methtable_t::frozen"] + [::std::mem::offset_of!(_jl_methtable_t, frozen) - 73usize]; +}; +pub const jl_small_typeof_tags_jl_null_tag: jl_small_typeof_tags = 0; +pub const jl_small_typeof_tags_jl_typeofbottom_tag: jl_small_typeof_tags = 1; +pub const jl_small_typeof_tags_jl_datatype_tag: jl_small_typeof_tags = 2; +pub const jl_small_typeof_tags_jl_unionall_tag: jl_small_typeof_tags = 3; +pub const jl_small_typeof_tags_jl_uniontype_tag: jl_small_typeof_tags = 4; +pub const jl_small_typeof_tags_jl_vararg_tag: jl_small_typeof_tags = 5; +pub const jl_small_typeof_tags_jl_tvar_tag: jl_small_typeof_tags = 6; +pub const jl_small_typeof_tags_jl_symbol_tag: jl_small_typeof_tags = 7; +pub const jl_small_typeof_tags_jl_module_tag: jl_small_typeof_tags = 8; +pub const jl_small_typeof_tags_jl_simplevector_tag: jl_small_typeof_tags = 9; +pub const jl_small_typeof_tags_jl_string_tag: jl_small_typeof_tags = 10; +pub const jl_small_typeof_tags_jl_task_tag: jl_small_typeof_tags = 11; +pub const jl_small_typeof_tags_jl_bool_tag: jl_small_typeof_tags = 12; +pub const jl_small_typeof_tags_jl_char_tag: jl_small_typeof_tags = 13; +pub const jl_small_typeof_tags_jl_int16_tag: jl_small_typeof_tags = 14; +pub const jl_small_typeof_tags_jl_int32_tag: jl_small_typeof_tags = 15; +pub const jl_small_typeof_tags_jl_int64_tag: jl_small_typeof_tags = 16; +pub const jl_small_typeof_tags_jl_int8_tag: jl_small_typeof_tags = 17; +pub const jl_small_typeof_tags_jl_uint16_tag: jl_small_typeof_tags = 18; +pub const jl_small_typeof_tags_jl_uint32_tag: jl_small_typeof_tags = 19; +pub const jl_small_typeof_tags_jl_uint64_tag: jl_small_typeof_tags = 20; +pub const jl_small_typeof_tags_jl_uint8_tag: jl_small_typeof_tags = 21; +pub const jl_small_typeof_tags_jl_tags_count: jl_small_typeof_tags = 22; +pub const jl_small_typeof_tags_jl_bitstags_first: jl_small_typeof_tags = 13; +pub const jl_small_typeof_tags_jl_max_tags: jl_small_typeof_tags = 64; +pub type jl_small_typeof_tags = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _jl_gcframe_t { + pub nroots: usize, + pub prev: *mut _jl_gcframe_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _jl_gcframe_t"][::std::mem::size_of::<_jl_gcframe_t>() - 16usize]; + ["Alignment of _jl_gcframe_t"][::std::mem::align_of::<_jl_gcframe_t>() - 8usize]; + ["Offset of field: _jl_gcframe_t::nroots"] + [::std::mem::offset_of!(_jl_gcframe_t, nroots) - 0usize]; + ["Offset of field: _jl_gcframe_t::prev"][::std::mem::offset_of!(_jl_gcframe_t, prev) - 8usize]; +}; +pub type jl_timing_block_t = _jl_timing_block_t; +pub type jl_excstack_t = _jl_excstack_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _jl_handler_t { + pub eh_ctx: sigjmp_buf, + pub gcstack: *mut jl_gcframe_t, + pub prev: *mut _jl_handler_t, + pub gc_state: i8, + pub locks_len: usize, + pub defer_signal: sig_atomic_t, + pub timing_stack: *mut jl_timing_block_t, + pub world_age: usize, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _jl_handler_t"][::std::mem::size_of::<_jl_handler_t>() - 256usize]; + ["Alignment of _jl_handler_t"][::std::mem::align_of::<_jl_handler_t>() - 8usize]; + ["Offset of field: _jl_handler_t::eh_ctx"] + [::std::mem::offset_of!(_jl_handler_t, eh_ctx) - 0usize]; + ["Offset of field: _jl_handler_t::gcstack"] + [::std::mem::offset_of!(_jl_handler_t, gcstack) - 200usize]; + ["Offset of field: _jl_handler_t::prev"] + [::std::mem::offset_of!(_jl_handler_t, prev) - 208usize]; + ["Offset of field: _jl_handler_t::gc_state"] + [::std::mem::offset_of!(_jl_handler_t, gc_state) - 216usize]; + ["Offset of field: _jl_handler_t::locks_len"] + [::std::mem::offset_of!(_jl_handler_t, locks_len) - 224usize]; + ["Offset of field: _jl_handler_t::defer_signal"] + [::std::mem::offset_of!(_jl_handler_t, defer_signal) - 232usize]; + ["Offset of field: _jl_handler_t::timing_stack"] + [::std::mem::offset_of!(_jl_handler_t, timing_stack) - 240usize]; + ["Offset of field: _jl_handler_t::world_age"] + [::std::mem::offset_of!(_jl_handler_t, world_age) - 248usize]; +}; +pub type jl_handler_t = _jl_handler_t; +#[repr(C)] +pub struct _jl_task_t { + pub next: *mut jl_value_t, + pub queue: *mut jl_value_t, + pub tls: *mut jl_value_t, + pub donenotify: *mut jl_value_t, + pub result: *mut jl_value_t, + pub scope: *mut jl_value_t, + pub start: *mut jl_function_t, + pub rngState: [u64; 5usize], + pub _state: std_atomic, + pub sticky: u8, + pub _isexception: std_atomic, + pub priority: u16, + pub tid: std_atomic, + pub threadpoolid: i8, + pub reentrant_timing: u8, + pub gcstack: *mut jl_gcframe_t, + pub world_age: usize, + pub ptls: jl_ptls_t, + pub excstack: *mut jl_excstack_t, + pub eh: *mut jl_handler_t, + pub ctx: jl_ucontext_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _jl_task_t"][::std::mem::size_of::<_jl_task_t>() - 184usize]; + ["Alignment of _jl_task_t"][::std::mem::align_of::<_jl_task_t>() - 8usize]; + ["Offset of field: _jl_task_t::next"][::std::mem::offset_of!(_jl_task_t, next) - 0usize]; + ["Offset of field: _jl_task_t::queue"][::std::mem::offset_of!(_jl_task_t, queue) - 8usize]; + ["Offset of field: _jl_task_t::tls"][::std::mem::offset_of!(_jl_task_t, tls) - 16usize]; + ["Offset of field: _jl_task_t::donenotify"] + [::std::mem::offset_of!(_jl_task_t, donenotify) - 24usize]; + ["Offset of field: _jl_task_t::result"][::std::mem::offset_of!(_jl_task_t, result) - 32usize]; + ["Offset of field: _jl_task_t::scope"][::std::mem::offset_of!(_jl_task_t, scope) - 40usize]; + ["Offset of field: _jl_task_t::start"][::std::mem::offset_of!(_jl_task_t, start) - 48usize]; + ["Offset of field: _jl_task_t::rngState"] + [::std::mem::offset_of!(_jl_task_t, rngState) - 56usize]; + ["Offset of field: _jl_task_t::_state"][::std::mem::offset_of!(_jl_task_t, _state) - 96usize]; + ["Offset of field: _jl_task_t::sticky"][::std::mem::offset_of!(_jl_task_t, sticky) - 97usize]; + ["Offset of field: _jl_task_t::_isexception"] + [::std::mem::offset_of!(_jl_task_t, _isexception) - 98usize]; + ["Offset of field: _jl_task_t::priority"] + [::std::mem::offset_of!(_jl_task_t, priority) - 100usize]; + ["Offset of field: _jl_task_t::tid"][::std::mem::offset_of!(_jl_task_t, tid) - 102usize]; + ["Offset of field: _jl_task_t::threadpoolid"] + [::std::mem::offset_of!(_jl_task_t, threadpoolid) - 104usize]; + ["Offset of field: _jl_task_t::reentrant_timing"] + [::std::mem::offset_of!(_jl_task_t, reentrant_timing) - 105usize]; + ["Offset of field: _jl_task_t::gcstack"] + [::std::mem::offset_of!(_jl_task_t, gcstack) - 112usize]; + ["Offset of field: _jl_task_t::world_age"] + [::std::mem::offset_of!(_jl_task_t, world_age) - 120usize]; + ["Offset of field: _jl_task_t::ptls"][::std::mem::offset_of!(_jl_task_t, ptls) - 128usize]; + ["Offset of field: _jl_task_t::excstack"] + [::std::mem::offset_of!(_jl_task_t, excstack) - 136usize]; + ["Offset of field: _jl_task_t::eh"][::std::mem::offset_of!(_jl_task_t, eh) - 144usize]; + ["Offset of field: _jl_task_t::ctx"][::std::mem::offset_of!(_jl_task_t, ctx) - 152usize]; +}; +pub type jl_task_t = _jl_task_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _jl_bt_element_t { + pub __bindgen_anon_1: _jl_bt_element_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _jl_bt_element_t__bindgen_ty_1 { + pub uintptr: usize, + pub jlvalue: *mut jl_value_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _jl_bt_element_t__bindgen_ty_1"] + [::std::mem::size_of::<_jl_bt_element_t__bindgen_ty_1>() - 8usize]; + ["Alignment of _jl_bt_element_t__bindgen_ty_1"] + [::std::mem::align_of::<_jl_bt_element_t__bindgen_ty_1>() - 8usize]; + ["Offset of field: _jl_bt_element_t__bindgen_ty_1::uintptr"] + [::std::mem::offset_of!(_jl_bt_element_t__bindgen_ty_1, uintptr) - 0usize]; + ["Offset of field: _jl_bt_element_t__bindgen_ty_1::jlvalue"] + [::std::mem::offset_of!(_jl_bt_element_t__bindgen_ty_1, jlvalue) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _jl_bt_element_t"][::std::mem::size_of::<_jl_bt_element_t>() - 8usize]; + ["Alignment of _jl_bt_element_t"][::std::mem::align_of::<_jl_bt_element_t>() - 8usize]; +}; +pub type jl_bt_element_t = _jl_bt_element_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _jl_excstack_t { + pub top: usize, + pub reserved_size: usize, } #[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]; + ["Size of _jl_excstack_t"][::std::mem::size_of::<_jl_excstack_t>() - 16usize]; + ["Alignment of _jl_excstack_t"][::std::mem::align_of::<_jl_excstack_t>() - 8usize]; + ["Offset of field: _jl_excstack_t::top"][::std::mem::offset_of!(_jl_excstack_t, top) - 0usize]; + ["Offset of field: _jl_excstack_t::reserved_size"] + [::std::mem::offset_of!(_jl_excstack_t, reserved_size) - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::align_of::>() - 8usize]; }; -pub type mmtk_jl_method_t = mmtk__jl_method_t; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_null_tag: mmtk_jl_small_typeof_tags = 0; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_typeofbottom_tag: mmtk_jl_small_typeof_tags = 1; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag: mmtk_jl_small_typeof_tags = 2; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_unionall_tag: mmtk_jl_small_typeof_tags = 3; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uniontype_tag: mmtk_jl_small_typeof_tags = 4; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_vararg_tag: mmtk_jl_small_typeof_tags = 5; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_tvar_tag: mmtk_jl_small_typeof_tags = 6; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_symbol_tag: mmtk_jl_small_typeof_tags = 7; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_module_tag: mmtk_jl_small_typeof_tags = 8; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_simplevector_tag: mmtk_jl_small_typeof_tags = 9; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_string_tag: mmtk_jl_small_typeof_tags = 10; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_task_tag: mmtk_jl_small_typeof_tags = 11; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_bool_tag: mmtk_jl_small_typeof_tags = 12; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_char_tag: mmtk_jl_small_typeof_tags = 13; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_int16_tag: mmtk_jl_small_typeof_tags = 14; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_int32_tag: mmtk_jl_small_typeof_tags = 15; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_int64_tag: mmtk_jl_small_typeof_tags = 16; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_int8_tag: mmtk_jl_small_typeof_tags = 17; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uint16_tag: mmtk_jl_small_typeof_tags = 18; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uint32_tag: mmtk_jl_small_typeof_tags = 19; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uint64_tag: mmtk_jl_small_typeof_tags = 20; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_uint8_tag: mmtk_jl_small_typeof_tags = 21; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_tags_count: mmtk_jl_small_typeof_tags = 22; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_bitstags_first: mmtk_jl_small_typeof_tags = 13; -pub const mmtk_jl_small_typeof_tags_mmtk_jl_max_tags: mmtk_jl_small_typeof_tags = 64; -pub type mmtk_jl_small_typeof_tags = ::std::os::raw::c_uint; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _bigval_t { + pub _address: u8, +} #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __locale_data { +pub struct _jl_gc_pagemeta_t { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_size_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_size_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _mallocmemory_t { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_int64_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_uint64_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_int8_t_close0"] + [::std::mem::size_of::>() - 1usize]; + ["Align of template specialization: std_atomic_open0_int8_t_close0"] + [::std::mem::align_of::>() - 1usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_int8_t_close0"] + [::std::mem::size_of::>() - 1usize]; + ["Align of template specialization: std_atomic_open0_int8_t_close0"] + [::std::mem::align_of::>() - 1usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _jl_value_t { +pub struct _jl_timing_block_t { pub _address: u8, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_sig_atomic_t_close0"] + [::std::mem::size_of::>() - 4usize]; + ["Align of template specialization: std_atomic_open0_sig_atomic_t_close0"] + [::std::mem::align_of::>() - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_int16_t_close0"] + [::std::mem::size_of::>() - 2usize]; + ["Align of template specialization: std_atomic_open0_int16_t_close0"] + [::std::mem::align_of::>() - 2usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_jl_ptr_kind_union_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_jl_ptr_kind_union_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_size_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_size_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_uint32_t_close0"] + [::std::mem::size_of::>() - 4usize]; + ["Align of template specialization: std_atomic_open0_uint32_t_close0"] + [::std::mem::align_of::>() - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_intptr_t_close0"] + [::std::mem::size_of::>() - 8usize]; + ["Align of template specialization: std_atomic_open0_intptr_t_close0"] + [::std::mem::align_of::>() - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_uint8_t_close0"] + [::std::mem::size_of::>() - 1usize]; + ["Align of template specialization: std_atomic_open0_uint8_t_close0"] + [::std::mem::align_of::>() - 1usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_uint8_t_close0"] + [::std::mem::size_of::>() - 1usize]; + ["Align of template specialization: std_atomic_open0_uint8_t_close0"] + [::std::mem::align_of::>() - 1usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of template specialization: std_atomic_open0_int16_t_close0"] + [::std::mem::size_of::>() - 2usize]; + ["Align of template specialization: std_atomic_open0_int16_t_close0"] + [::std::mem::align_of::>() - 2usize]; +}; diff --git a/mmtk/src/lib.rs b/mmtk/src/lib.rs index c15b49df..78e8bebf 100644 --- a/mmtk/src/lib.rs +++ b/mmtk/src/lib.rs @@ -11,7 +11,6 @@ use mmtk::MMTKBuilder; use mmtk::MMTK; use std::collections::HashMap; -use std::ptr::null_mut; use std::sync::atomic::AtomicIsize; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Condvar, Mutex, RwLock}; @@ -94,30 +93,25 @@ lazy_static! { type ProcessSlotFn = *const extern "C" fn(closure: Address, slot: Address); -#[repr(C)] -pub struct Julia_Upcalls { - pub scan_julia_exc_obj: - extern "C" fn(obj: Address, closure: Address, process_slot: ProcessSlotFn), - pub get_stackbase: extern "C" fn(tid: u16) -> usize, - pub jl_throw_out_of_memory_error: extern "C" fn(), - pub jl_get_gc_disable_counter: extern "C" fn() -> u32, - pub mmtk_sweep_malloced_array: extern "C" fn(), - pub mmtk_sweep_stack_pools: extern "C" fn(), - pub wait_in_a_safepoint: extern "C" fn(), - pub exit_from_safepoint: extern "C" fn(old_state: i8), - pub jl_hrtime: extern "C" fn() -> u64, - pub update_gc_stats: extern "C" fn(u64, usize, bool), - pub get_abi_structs_checksum_c: extern "C" fn() -> usize, - pub get_thread_finalizer_list: extern "C" fn(tls: OpaquePointer) -> Address, - pub get_to_finalize_list: extern "C" fn() -> Address, - pub get_marked_finalizers_list: extern "C" fn() -> Address, - pub arraylist_grow: extern "C" fn(Address, usize), - pub get_jl_gc_have_pending_finalizers: extern "C" fn() -> *mut i32, - pub scan_vm_specific_roots: extern "C" fn(closure: *mut crate::slots::RootsWorkClosure), - pub update_inlined_array: extern "C" fn(to: Address, from: Address), - pub prepare_to_collect: extern "C" fn(), - pub get_owner_address: extern "C" fn(m: Address) -> Address, - pub mmtk_genericmemory_how: extern "C" fn(m: Address) -> usize, +#[allow(improper_ctypes)] +extern "C" { + pub fn jl_gc_scan_julia_exc_obj(obj: Address, closure: Address, process_slot: ProcessSlotFn); + pub fn jl_gc_get_stackbase(tid: i16) -> usize; + pub fn jl_throw_out_of_memory_error(); + pub fn jl_get_gc_disable_counter() -> u32; + pub fn jl_gc_mmtk_sweep_malloced_memory(); + pub fn jl_gc_mmtk_sweep_stack_pools(); + pub fn jl_hrtime() -> u64; + pub fn jl_gc_update_stats(t: u64, mmtk_live_bytes: usize, is_nursery: bool); + pub fn jl_gc_get_abi_structs_checksum_c() -> usize; + pub fn jl_gc_get_thread_finalizer_list(tls: OpaquePointer) -> Address; + pub fn jl_gc_get_to_finalize_list() -> Address; + pub fn jl_gc_get_marked_finalizers_list() -> Address; + pub fn arraylist_grow(a: Address, n: usize); + pub fn jl_gc_get_have_pending_finalizers() -> *mut i32; + pub fn jl_gc_scan_vm_specific_roots(closure: *mut crate::slots::RootsWorkClosure); + pub fn jl_gc_update_inlined_array(to: Address, from: Address); + pub fn jl_gc_prepare_to_collect(); + pub fn jl_gc_get_owner_address_to_mmtk(m: Address) -> Address; + pub fn jl_gc_genericmemory_how(m: Address) -> usize; } - -pub static mut UPCALLS: *const Julia_Upcalls = null_mut(); diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index f55d04aa..21c48d3f 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -1,9 +1,10 @@ use crate::api::mmtk_get_obj_size; +use crate::jl_gc_genericmemory_how; +use crate::jl_gc_update_inlined_array; use crate::julia_scanning::{ - jl_genericmemory_typename, jl_small_typeof, mmtk_jl_genericmemory_how, mmtk_jl_typeof, - mmtk_jl_typetagof, + jl_genericmemory_typename, jl_small_typeof, mmtk_jl_typeof, mmtk_jl_typetagof, }; -use crate::{julia_types::*, UPCALLS}; +use crate::julia_types::*; use crate::{JuliaVM, JULIA_BUFF_TAG, JULIA_HEADER_SIZE}; use log::trace; use mmtk::util::copy::*; @@ -94,7 +95,7 @@ impl ObjectModel for VMObjectModel { let vt = mmtk_jl_typeof(from.to_raw_address()); if (*vt).name == jl_genericmemory_typename { - ((*UPCALLS).update_inlined_array)(from.to_raw_address(), to_obj.to_raw_address()) + jl_gc_update_inlined_array(from.to_raw_address(), to_obj.to_raw_address()) } } @@ -186,21 +187,20 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { return mmtk_get_obj_size(object); } - if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_unionall_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_uniontype_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_tvar_tag as usize) << 4) - || vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_vararg_tag as usize) << 4) + if vtag_usize == ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_unionall_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_uniontype_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_tvar_tag as usize) << 4) + || vtag_usize == ((jl_small_typeof_tags_jl_vararg_tag as usize) << 4) { // these objects have pointers in them, but no other special handling // so we want these to fall through to the end vtag_usize = jl_small_typeof[vtag.as_usize() / std::mem::size_of::
()] as usize; vtag = Address::from_usize(vtag_usize); - } else if vtag_usize < ((mmtk_jl_small_typeof_tags_mmtk_jl_max_tags as usize) << 4) { - if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_simplevector_tag as usize) << 4) { - let length = (*obj_address.to_ptr::()).length as usize; - let dtsz = - length * std::mem::size_of::
() + std::mem::size_of::(); + } else if vtag_usize < ((jl_small_typeof_tags_jl_max_tags as usize) << 4) { + if vtag_usize == ((jl_small_typeof_tags_jl_simplevector_tag as usize) << 4) { + let length = (*obj_address.to_ptr::()).length as usize; + let dtsz = length * std::mem::size_of::
() + std::mem::size_of::(); debug_assert!( dtsz + JULIA_HEADER_SIZE <= 2032, @@ -209,10 +209,8 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { ); return llt_align(dtsz + JULIA_HEADER_SIZE, 16); - } else if vtag_usize - == ((mmtk_jl_small_typeof_tags_mmtk_jl_module_tag as usize) << 4) as usize - { - let dtsz = std::mem::size_of::(); + } else if vtag_usize == ((jl_small_typeof_tags_jl_module_tag as usize) << 4) as usize { + let dtsz = std::mem::size_of::(); debug_assert!( dtsz + JULIA_HEADER_SIZE <= 2032, "size {} greater than minimum!", @@ -220,8 +218,8 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { ); return llt_align(dtsz + JULIA_HEADER_SIZE, 16); - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_task_tag as usize) << 4) { - let dtsz = std::mem::size_of::(); + } else if vtag_usize == ((jl_small_typeof_tags_jl_task_tag as usize) << 4) { + let dtsz = std::mem::size_of::(); debug_assert!( dtsz + JULIA_HEADER_SIZE <= 2032, "size {} greater than minimum!", @@ -229,7 +227,7 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { ); return llt_align(dtsz + JULIA_HEADER_SIZE, 16); - } else if vtag_usize == ((mmtk_jl_small_typeof_tags_mmtk_jl_string_tag as usize) << 4) { + } else if vtag_usize == ((jl_small_typeof_tags_jl_string_tag as usize) << 4) { let length = object.to_raw_address().load::(); let dtsz = length + std::mem::size_of::() + 1; @@ -254,40 +252,39 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize { return llt_align(dtsz + JULIA_HEADER_SIZE, 16); } } else { - let vt = vtag.to_ptr::(); + let vt = vtag.to_ptr::(); let type_tag = mmtk_jl_typetagof(vtag); - if type_tag.as_usize() != ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4) + if type_tag.as_usize() != ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4) || (*vt).smalltag() != 0 { panic!( "GC error (probable corruption) - !jl_is_datatype(vt) = {}; vt->smalltag = {}, vt = {:?}", - type_tag.as_usize() != ((mmtk_jl_small_typeof_tags_mmtk_jl_datatype_tag as usize) << 4), - (*(vtag.to_ptr::())).smalltag() != 0, + type_tag.as_usize() != ((jl_small_typeof_tags_jl_datatype_tag as usize) << 4), + (*(vtag.to_ptr::())).smalltag() != 0, vt ); } } let obj_type = mmtk_jl_typeof(obj_address); - let vt = vtag.to_ptr::(); + let vt = vtag.to_ptr::(); assert_eq!(obj_type, vt); if (*vt).name == jl_genericmemory_typename { - let m = obj_address.to_ptr::(); - let how = mmtk_jl_genericmemory_how(m); + let m = obj_address.to_ptr::(); + let how = jl_gc_genericmemory_how(obj_address); let res = if how == 0 { - let layout = (*(mmtk_jl_typetagof(obj_address).to_ptr::())).layout; + let layout = (*(mmtk_jl_typetagof(obj_address).to_ptr::())).layout; let mut sz = (*layout).size as usize * (*m).length as usize; if (*layout).flags.arrayelem_isunion() != 0 { sz += (*m).length as usize; } - let dtsz = llt_align(std::mem::size_of::(), 16); + let dtsz = llt_align(std::mem::size_of::(), 16); llt_align(sz + dtsz + JULIA_HEADER_SIZE, 16) } else { - let dtsz = - std::mem::size_of::() + std::mem::size_of::
(); + let dtsz = std::mem::size_of::() + std::mem::size_of::
(); llt_align(dtsz + JULIA_HEADER_SIZE, 16) }; @@ -325,7 +322,7 @@ pub unsafe fn llt_align(size: usize, align: usize) -> usize { } #[inline(always)] -pub unsafe fn mmtk_jl_is_uniontype(t: *const mmtk_jl_datatype_t) -> bool { +pub unsafe fn mmtk_jl_is_uniontype(t: *const jl_datatype_t) -> bool { mmtk_jl_typetagof(Address::from_ptr(t)).as_usize() - == (mmtk_jl_small_typeof_tags_mmtk_jl_uniontype_tag << 4) as usize + == (jl_small_typeof_tags_jl_uniontype_tag << 4) as usize } diff --git a/mmtk/src/reference_glue.rs b/mmtk/src/reference_glue.rs index c7fc8f6f..9805803a 100644 --- a/mmtk/src/reference_glue.rs +++ b/mmtk/src/reference_glue.rs @@ -7,7 +7,7 @@ use mmtk::vm::Finalizable; use mmtk::vm::ReferenceGlue; extern "C" { - pub static jl_nothing: *mut mmtk_jl_value_t; + pub static jl_nothing: *mut jl_value_t; } #[derive(Copy, Clone, Eq, Hash, PartialOrd, PartialEq, Debug)] @@ -36,13 +36,13 @@ impl Finalizable for JuliaFinalizableObject { pub struct VMReferenceGlue {} impl VMReferenceGlue { - fn load_referent_raw(reference: ObjectReference) -> *mut mmtk_jl_value_t { - let reff = reference.to_raw_address().to_ptr::(); + fn load_referent_raw(reference: ObjectReference) -> *mut jl_value_t { + let reff = reference.to_raw_address().to_ptr::(); unsafe { (*reff).value } } - fn set_referent_raw(reference: ObjectReference, referent_raw: *mut mmtk_jl_value_t) { - let reff = reference.to_raw_address().to_mut_ptr::(); + fn set_referent_raw(reference: ObjectReference, referent_raw: *mut jl_value_t) { + let reff = reference.to_raw_address().to_mut_ptr::(); unsafe { (*reff).value = referent_raw; } diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index da721240..7f21dd92 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -1,5 +1,5 @@ use crate::slots::JuliaVMSlot; -use crate::{SINGLETON, UPCALLS}; +use crate::SINGLETON; use mmtk::memory_manager; use mmtk::scheduler::*; use mmtk::util::opaque_pointer::*; @@ -13,6 +13,9 @@ use mmtk::vm::VMBinding; use mmtk::Mutator; use mmtk::MMTK; +use crate::jl_gc_mmtk_sweep_malloced_memory; +use crate::jl_gc_mmtk_sweep_stack_pools; +use crate::jl_gc_scan_vm_specific_roots; use crate::JuliaVM; pub struct VMScanning {} @@ -49,12 +52,12 @@ impl Scanning for VMScanning { use crate::julia_types::*; use mmtk::util::Address; - let ptls: &mut mmtk__jl_tls_states_t = unsafe { std::mem::transmute(mutator.mutator_tls) }; + let ptls: &mut _jl_tls_states_t = unsafe { std::mem::transmute(mutator.mutator_tls) }; let mut slot_buffer = SlotBuffer { buffer: vec![] }; // need to be tpinned as they're all from the shadow stack let mut node_buffer = vec![]; // Scan thread local from ptls: See gc_queue_thread_local in gc.c - let mut root_scan_task = |task: *const mmtk__jl_task_t, task_is_root: bool| { + let mut root_scan_task = |task: *const _jl_task_t, task_is_root: bool| { if !task.is_null() { unsafe { crate::julia_scanning::mmtk_scan_gcstack(task, &mut slot_buffer); @@ -84,12 +87,12 @@ impl Scanning for VMScanning { while i < ptls.gc_tls_common.heap.live_tasks.len { let mut task_address = Address::from_ptr(ptls.gc_tls_common.heap.live_tasks.items); task_address = task_address.shift::
(i as isize); - let task = unsafe { task_address.load::<*const mmtk_jl_task_t>() }; + let task = unsafe { task_address.load::<*const jl_task_t>() }; root_scan_task(task, false); i += 1; } - root_scan_task(ptls.current_task as *mut mmtk__jl_task_t, true); + root_scan_task(ptls.current_task as *mut _jl_task_t, true); root_scan_task(ptls.next_task, true); root_scan_task(ptls.previous_task, true); if !ptls.previous_exception.is_null() { @@ -150,7 +153,7 @@ impl Scanning for VMScanning { use crate::slots::RootsWorkClosure; let mut roots_closure = RootsWorkClosure::from_roots_work_factory(&mut factory); unsafe { - ((*UPCALLS).scan_vm_specific_roots)(&mut roots_closure as _); + jl_gc_scan_vm_specific_roots(&mut roots_closure as _); } } @@ -213,9 +216,9 @@ impl SweepVMSpecific { impl GCWork for SweepVMSpecific { fn do_work(&mut self, _worker: &mut GCWorker, _mmtk: &'static MMTK) { - // call sweep malloced arrays and sweep stack pools from UPCALLS - unsafe { ((*UPCALLS).mmtk_sweep_malloced_array)() } - unsafe { ((*UPCALLS).mmtk_sweep_stack_pools)() } + // call sweep malloced arrays and sweep stack pools + unsafe { jl_gc_mmtk_sweep_malloced_memory() } + unsafe { jl_gc_mmtk_sweep_stack_pools() } self.swept = true; } } diff --git a/mmtk/src/util.rs b/mmtk/src/util.rs index 8ea72b2d..7ef9d6de 100644 --- a/mmtk/src/util.rs +++ b/mmtk/src/util.rs @@ -36,51 +36,10 @@ impl RootLabel { } } -const PRINT_STRUCT_SIZE: bool = false; - -macro_rules! print_sizeof { - ($t: ty) => {{ - let sz = std::mem::size_of::<$t>(); - if PRINT_STRUCT_SIZE { - println!("Rust {} = {} bytes", stringify!($t), sz); - } - sz - }}; -} - -pub(crate) fn get_abi_structs_checksum_rust() -> usize { - use crate::julia_types::*; - print_sizeof!(mmtk::Mutator) - ^ print_sizeof!(mmtk__jl_taggedvalue_bits) - ^ print_sizeof!(mmtk_jl_taggedvalue_t) - ^ print_sizeof!(mmtk_jl_datatype_layout_t) - ^ print_sizeof!(mmtk_jl_typename_t) - ^ print_sizeof!(mmtk_jl_svec_t) - ^ print_sizeof!(mmtk_jl_datatype_t) - ^ print_sizeof!(mmtk_jl_array_t) - ^ print_sizeof!(mmtk_jl_sym_t) - ^ print_sizeof!(mmtk_jl_binding_t) - ^ print_sizeof!(mmtk_htable_t) - ^ print_sizeof!(mmtk_arraylist_t) - ^ print_sizeof!(mmtk_jl_uuid_t) - ^ print_sizeof!(mmtk_jl_mutex_t) - ^ print_sizeof!(mmtk_jl_module_t) - ^ print_sizeof!(mmtk_jl_excstack_t) - ^ print_sizeof!(mmtk_jl_bt_element_t) - ^ print_sizeof!(mmtk_jl_stack_context_t) - ^ print_sizeof!(mmtk_jl_ucontext_t) - ^ print_sizeof!(mmtk__jl_gcframe_t) - ^ print_sizeof!(mmtk_jl_task_t) - ^ print_sizeof!(mmtk_jl_weakref_t) - ^ print_sizeof!(mmtk_jl_tls_states_t) - ^ print_sizeof!(mmtk_jl_thread_heap_common_t) - ^ print_sizeof!(mmtk_jl_thread_gc_num_common_t) -} - // The functions below allow accessing the values of bitfields without performing a for loop -use crate::julia_types::{__BindgenBitfieldUnit, mmtk_jl_datatype_layout_t, mmtk_jl_ucontext_t}; +use crate::julia_types::{__BindgenBitfieldUnit, jl_datatype_layout_t, jl_ucontext_t}; -impl mmtk_jl_datatype_layout_t { +impl jl_datatype_layout_t { #[inline] pub fn fielddesc_type_custom(&self) -> u16 { let fielddesc_type_raw: u16 = unsafe { @@ -92,7 +51,7 @@ impl mmtk_jl_datatype_layout_t { } } -impl mmtk_jl_ucontext_t { +impl jl_ucontext_t { #[inline] pub fn copy_stack_custom(&self) -> u32 { let copy_stack_raw: u32 = unsafe { From 4791a62bb800dec686d6871d96e8ac2cc8324b15 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 05:34:46 +0000 Subject: [PATCH 18/32] This file will be generated by build.rs --- mmtk/src/julia_types.rs | 1820 --------------------------------------- 1 file changed, 1820 deletions(-) delete mode 100644 mmtk/src/julia_types.rs diff --git a/mmtk/src/julia_types.rs b/mmtk/src/julia_types.rs deleted file mode 100644 index e5b5e00e..00000000 --- a/mmtk/src/julia_types.rs +++ /dev/null @@ -1,1820 +0,0 @@ -/* automatically generated by rust-bindgen 0.70.1 */ - -#[repr(C)] -#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct __BindgenBitfieldUnit { - storage: Storage, -} -impl __BindgenBitfieldUnit { - #[inline] - pub const fn new(storage: Storage) -> Self { - Self { storage } - } -} -impl __BindgenBitfieldUnit -where - Storage: AsRef<[u8]> + AsMut<[u8]>, -{ - #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - byte & mask == mask - } - #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - if val { - *byte |= mask; - } else { - *byte &= !mask; - } - } - #[inline] - pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - let mut val = 0; - for i in 0..(bit_width as usize) { - if self.get_bit(i + bit_offset) { - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - val |= 1 << index; - } - } - val - } - #[inline] - pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - for i in 0..(bit_width as usize) { - let mask = 1 << i; - let val_bit_is_set = val & mask == mask; - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - self.set_bit(index + bit_offset, val_bit_is_set); - } - } -} -#[repr(C)] -#[derive(Default)] -pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); -impl __IncompleteArrayField { - #[inline] - pub const fn new() -> Self { - __IncompleteArrayField(::std::marker::PhantomData, []) - } - #[inline] - pub fn as_ptr(&self) -> *const T { - self as *const _ as *const T - } - #[inline] - pub fn as_mut_ptr(&mut self) -> *mut T { - self as *mut _ as *mut T - } - #[inline] - pub unsafe fn as_slice(&self, len: usize) -> &[T] { - ::std::slice::from_raw_parts(self.as_ptr(), len) - } - #[inline] - pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { - ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) - } -} -impl ::std::fmt::Debug for __IncompleteArrayField { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - fmt.write_str("__IncompleteArrayField") - } -} -#[repr(C)] -#[derive(Debug)] -pub struct std_atomic<_Tp> { - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Tp>>, - pub _M_i: _Tp, -} -pub type std_atomic_value_type<_Tp> = _Tp; -pub type __sig_atomic_t = ::std::os::raw::c_int; -pub type jl_gcframe_t = _jl_gcframe_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sigset_t { - pub __val: [::std::os::raw::c_ulong; 16usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __sigset_t"][::std::mem::size_of::<__sigset_t>() - 128usize]; - ["Alignment of __sigset_t"][::std::mem::align_of::<__sigset_t>() - 8usize]; - ["Offset of field: __sigset_t::__val"][::std::mem::offset_of!(__sigset_t, __val) - 0usize]; -}; -pub type pthread_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct arraylist_t { - pub len: usize, - pub max: usize, - pub items: *mut *mut ::std::os::raw::c_void, - pub _space: [*mut ::std::os::raw::c_void; 29usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of arraylist_t"][::std::mem::size_of::() - 256usize]; - ["Alignment of arraylist_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: arraylist_t::len"][::std::mem::offset_of!(arraylist_t, len) - 0usize]; - ["Offset of field: arraylist_t::max"][::std::mem::offset_of!(arraylist_t, max) - 8usize]; - ["Offset of field: arraylist_t::items"][::std::mem::offset_of!(arraylist_t, items) - 16usize]; - ["Offset of field: arraylist_t::_space"][::std::mem::offset_of!(arraylist_t, _space) - 24usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct small_arraylist_t { - pub len: u32, - pub max: u32, - pub items: *mut *mut ::std::os::raw::c_void, - pub _space: [*mut ::std::os::raw::c_void; 6usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of small_arraylist_t"][::std::mem::size_of::() - 64usize]; - ["Alignment of small_arraylist_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: small_arraylist_t::len"] - [::std::mem::offset_of!(small_arraylist_t, len) - 0usize]; - ["Offset of field: small_arraylist_t::max"] - [::std::mem::offset_of!(small_arraylist_t, max) - 4usize]; - ["Offset of field: small_arraylist_t::items"] - [::std::mem::offset_of!(small_arraylist_t, items) - 8usize]; - ["Offset of field: small_arraylist_t::_space"] - [::std::mem::offset_of!(small_arraylist_t, _space) - 16usize]; -}; -pub type __jmp_buf = [::std::os::raw::c_long; 8usize]; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __jmp_buf_tag { - pub __jmpbuf: __jmp_buf, - pub __mask_was_saved: ::std::os::raw::c_int, - pub __saved_mask: __sigset_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __jmp_buf_tag"][::std::mem::size_of::<__jmp_buf_tag>() - 200usize]; - ["Alignment of __jmp_buf_tag"][::std::mem::align_of::<__jmp_buf_tag>() - 8usize]; - ["Offset of field: __jmp_buf_tag::__jmpbuf"] - [::std::mem::offset_of!(__jmp_buf_tag, __jmpbuf) - 0usize]; - ["Offset of field: __jmp_buf_tag::__mask_was_saved"] - [::std::mem::offset_of!(__jmp_buf_tag, __mask_was_saved) - 64usize]; - ["Offset of field: __jmp_buf_tag::__saved_mask"] - [::std::mem::offset_of!(__jmp_buf_tag, __saved_mask) - 72usize]; -}; -pub type sigjmp_buf = [__jmp_buf_tag; 1usize]; -pub type jl_taggedvalue_t = _jl_taggedvalue_t; -pub type jl_ptls_t = *mut _jl_tls_states_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_value_t { - _unused: [u8; 0], -} -pub type sig_atomic_t = __sig_atomic_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ws_array_t { - pub buffer: *mut ::std::os::raw::c_char, - pub capacity: i32, - pub mask: i32, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of ws_array_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of ws_array_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: ws_array_t::buffer"][::std::mem::offset_of!(ws_array_t, buffer) - 0usize]; - ["Offset of field: ws_array_t::capacity"] - [::std::mem::offset_of!(ws_array_t, capacity) - 8usize]; - ["Offset of field: ws_array_t::mask"][::std::mem::offset_of!(ws_array_t, mask) - 12usize]; -}; -#[repr(C)] -#[repr(align(64))] -#[derive(Debug)] -pub struct ws_queue_t { - pub top: std_atomic, - pub __bindgen_padding_0: [u64; 7usize], - pub bottom: std_atomic, - pub __bindgen_padding_1: [u64; 7usize], - pub array: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of ws_queue_t"][::std::mem::size_of::() - 192usize]; - ["Alignment of ws_queue_t"][::std::mem::align_of::() - 64usize]; - ["Offset of field: ws_queue_t::top"][::std::mem::offset_of!(ws_queue_t, top) - 0usize]; - ["Offset of field: ws_queue_t::bottom"][::std::mem::offset_of!(ws_queue_t, bottom) - 64usize]; - ["Offset of field: ws_queue_t::array"][::std::mem::offset_of!(ws_queue_t, array) - 128usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_gc_pool_t { - pub freelist: *mut _jl_taggedvalue_t, - pub newpages: *mut _jl_taggedvalue_t, - pub osize: u16, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_gc_pool_t"][::std::mem::size_of::() - 24usize]; - ["Alignment of jl_gc_pool_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_gc_pool_t::freelist"] - [::std::mem::offset_of!(jl_gc_pool_t, freelist) - 0usize]; - ["Offset of field: jl_gc_pool_t::newpages"] - [::std::mem::offset_of!(jl_gc_pool_t, newpages) - 8usize]; - ["Offset of field: jl_gc_pool_t::osize"][::std::mem::offset_of!(jl_gc_pool_t, osize) - 16usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_thread_heap_t { - pub young_generation_of_bigvals: *mut _bigval_t, - pub remset_nptr: ::std::os::raw::c_int, - pub remset: arraylist_t, - pub norm_pools: [jl_gc_pool_t; 51usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_thread_heap_t"][::std::mem::size_of::() - 1496usize]; - ["Alignment of jl_thread_heap_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_thread_heap_t::young_generation_of_bigvals"] - [::std::mem::offset_of!(jl_thread_heap_t, young_generation_of_bigvals) - 0usize]; - ["Offset of field: jl_thread_heap_t::remset_nptr"] - [::std::mem::offset_of!(jl_thread_heap_t, remset_nptr) - 8usize]; - ["Offset of field: jl_thread_heap_t::remset"] - [::std::mem::offset_of!(jl_thread_heap_t, remset) - 16usize]; - ["Offset of field: jl_thread_heap_t::norm_pools"] - [::std::mem::offset_of!(jl_thread_heap_t, norm_pools) - 272usize]; -}; -#[repr(C)] -#[repr(align(64))] -#[derive(Debug)] -pub struct jl_gc_markqueue_t { - pub chunk_queue: ws_queue_t, - pub ptr_queue: ws_queue_t, - pub reclaim_set: arraylist_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_gc_markqueue_t"][::std::mem::size_of::() - 640usize]; - ["Alignment of jl_gc_markqueue_t"][::std::mem::align_of::() - 64usize]; - ["Offset of field: jl_gc_markqueue_t::chunk_queue"] - [::std::mem::offset_of!(jl_gc_markqueue_t, chunk_queue) - 0usize]; - ["Offset of field: jl_gc_markqueue_t::ptr_queue"] - [::std::mem::offset_of!(jl_gc_markqueue_t, ptr_queue) - 192usize]; - ["Offset of field: jl_gc_markqueue_t::reclaim_set"] - [::std::mem::offset_of!(jl_gc_markqueue_t, reclaim_set) - 384usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_gc_mark_cache_t { - pub perm_scanned_bytes: usize, - pub scanned_bytes: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_gc_mark_cache_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of jl_gc_mark_cache_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_gc_mark_cache_t::perm_scanned_bytes"] - [::std::mem::offset_of!(jl_gc_mark_cache_t, perm_scanned_bytes) - 0usize]; - ["Offset of field: jl_gc_mark_cache_t::scanned_bytes"] - [::std::mem::offset_of!(jl_gc_mark_cache_t, scanned_bytes) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_gc_page_stack_t { - pub bottom: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_gc_page_stack_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of jl_gc_page_stack_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_gc_page_stack_t::bottom"] - [::std::mem::offset_of!(jl_gc_page_stack_t, bottom) - 0usize]; -}; -#[repr(C)] -#[repr(align(64))] -#[derive(Debug)] -pub struct jl_gc_tls_states_t { - pub heap: jl_thread_heap_t, - pub page_metadata_allocd: jl_gc_page_stack_t, - pub __bindgen_padding_0: [u64; 4usize], - pub mark_queue: jl_gc_markqueue_t, - pub gc_cache: jl_gc_mark_cache_t, - pub gc_sweeps_requested: std_atomic, - pub sweep_objs: arraylist_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_gc_tls_states_t"][::std::mem::size_of::() - 2496usize]; - ["Alignment of jl_gc_tls_states_t"][::std::mem::align_of::() - 64usize]; - ["Offset of field: jl_gc_tls_states_t::heap"] - [::std::mem::offset_of!(jl_gc_tls_states_t, heap) - 0usize]; - ["Offset of field: jl_gc_tls_states_t::page_metadata_allocd"] - [::std::mem::offset_of!(jl_gc_tls_states_t, page_metadata_allocd) - 1496usize]; - ["Offset of field: jl_gc_tls_states_t::mark_queue"] - [::std::mem::offset_of!(jl_gc_tls_states_t, mark_queue) - 1536usize]; - ["Offset of field: jl_gc_tls_states_t::gc_cache"] - [::std::mem::offset_of!(jl_gc_tls_states_t, gc_cache) - 2176usize]; - ["Offset of field: jl_gc_tls_states_t::gc_sweeps_requested"] - [::std::mem::offset_of!(jl_gc_tls_states_t, gc_sweeps_requested) - 2192usize]; - ["Offset of field: jl_gc_tls_states_t::sweep_objs"] - [::std::mem::offset_of!(jl_gc_tls_states_t, sweep_objs) - 2200usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_thread_heap_common_t { - pub weak_refs: small_arraylist_t, - pub live_tasks: small_arraylist_t, - pub mallocarrays: *mut _mallocmemory_t, - pub mafreelist: *mut _mallocmemory_t, - pub free_stacks: [small_arraylist_t; 16usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_thread_heap_common_t"] - [::std::mem::size_of::() - 1168usize]; - ["Alignment of jl_thread_heap_common_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_thread_heap_common_t::weak_refs"] - [::std::mem::offset_of!(jl_thread_heap_common_t, weak_refs) - 0usize]; - ["Offset of field: jl_thread_heap_common_t::live_tasks"] - [::std::mem::offset_of!(jl_thread_heap_common_t, live_tasks) - 64usize]; - ["Offset of field: jl_thread_heap_common_t::mallocarrays"] - [::std::mem::offset_of!(jl_thread_heap_common_t, mallocarrays) - 128usize]; - ["Offset of field: jl_thread_heap_common_t::mafreelist"] - [::std::mem::offset_of!(jl_thread_heap_common_t, mafreelist) - 136usize]; - ["Offset of field: jl_thread_heap_common_t::free_stacks"] - [::std::mem::offset_of!(jl_thread_heap_common_t, free_stacks) - 144usize]; -}; -#[repr(C)] -#[derive(Debug)] -pub struct jl_thread_gc_num_common_t { - pub allocd: std_atomic, - pub pool_live_bytes: std_atomic, - pub malloc: std_atomic, - pub realloc: std_atomic, - pub poolalloc: std_atomic, - pub bigalloc: std_atomic, - pub free_acc: std_atomic, - pub alloc_acc: std_atomic, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_thread_gc_num_common_t"] - [::std::mem::size_of::() - 64usize]; - ["Alignment of jl_thread_gc_num_common_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_thread_gc_num_common_t::allocd"] - [::std::mem::offset_of!(jl_thread_gc_num_common_t, allocd) - 0usize]; - ["Offset of field: jl_thread_gc_num_common_t::pool_live_bytes"] - [::std::mem::offset_of!(jl_thread_gc_num_common_t, pool_live_bytes) - 8usize]; - ["Offset of field: jl_thread_gc_num_common_t::malloc"] - [::std::mem::offset_of!(jl_thread_gc_num_common_t, malloc) - 16usize]; - ["Offset of field: jl_thread_gc_num_common_t::realloc"] - [::std::mem::offset_of!(jl_thread_gc_num_common_t, realloc) - 24usize]; - ["Offset of field: jl_thread_gc_num_common_t::poolalloc"] - [::std::mem::offset_of!(jl_thread_gc_num_common_t, poolalloc) - 32usize]; - ["Offset of field: jl_thread_gc_num_common_t::bigalloc"] - [::std::mem::offset_of!(jl_thread_gc_num_common_t, bigalloc) - 40usize]; - ["Offset of field: jl_thread_gc_num_common_t::free_acc"] - [::std::mem::offset_of!(jl_thread_gc_num_common_t, free_acc) - 48usize]; - ["Offset of field: jl_thread_gc_num_common_t::alloc_acc"] - [::std::mem::offset_of!(jl_thread_gc_num_common_t, alloc_acc) - 56usize]; -}; -#[repr(C)] -#[derive(Debug)] -pub struct jl_gc_tls_states_common_t { - pub heap: jl_thread_heap_common_t, - pub gc_num: jl_thread_gc_num_common_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_gc_tls_states_common_t"] - [::std::mem::size_of::() - 1232usize]; - ["Alignment of jl_gc_tls_states_common_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_gc_tls_states_common_t::heap"] - [::std::mem::offset_of!(jl_gc_tls_states_common_t, heap) - 0usize]; - ["Offset of field: jl_gc_tls_states_common_t::gc_num"] - [::std::mem::offset_of!(jl_gc_tls_states_common_t, gc_num) - 1168usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_stack_context_t { - pub uc_mcontext: sigjmp_buf, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_stack_context_t"][::std::mem::size_of::() - 200usize]; - ["Alignment of jl_stack_context_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_stack_context_t::uc_mcontext"] - [::std::mem::offset_of!(jl_stack_context_t, uc_mcontext) - 0usize]; -}; -pub type _jl_ucontext_t = jl_stack_context_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct jl_ucontext_t { - pub __bindgen_anon_1: 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 jl_ucontext_t__bindgen_ty_1 { - pub ctx: *mut _jl_ucontext_t, - pub copy_ctx: *mut jl_stack_context_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_ucontext_t__bindgen_ty_1"] - [::std::mem::size_of::() - 8usize]; - ["Alignment of jl_ucontext_t__bindgen_ty_1"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_ucontext_t__bindgen_ty_1::ctx"] - [::std::mem::offset_of!(jl_ucontext_t__bindgen_ty_1, ctx) - 0usize]; - ["Offset of field: jl_ucontext_t__bindgen_ty_1::copy_ctx"] - [::std::mem::offset_of!(jl_ucontext_t__bindgen_ty_1, copy_ctx) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_ucontext_t"][::std::mem::size_of::() - 32usize]; - ["Alignment of jl_ucontext_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_ucontext_t::stkbuf"] - [::std::mem::offset_of!(jl_ucontext_t, stkbuf) - 8usize]; - ["Offset of field: jl_ucontext_t::bufsz"] - [::std::mem::offset_of!(jl_ucontext_t, bufsz) - 16usize]; -}; -impl 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 jl_thread_t = pthread_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_mutex_t { - pub owner: u64, - pub count: u32, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_mutex_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of jl_mutex_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_mutex_t::owner"][::std::mem::offset_of!(jl_mutex_t, owner) - 0usize]; - ["Offset of field: jl_mutex_t::count"][::std::mem::offset_of!(jl_mutex_t, count) - 8usize]; -}; -#[repr(C)] -#[repr(align(64))] -#[derive(Debug)] -pub struct _jl_tls_states_t { - pub tid: i16, - pub threadpoolid: i8, - pub rngseed: u64, - pub safepoint: u64, - pub sleep_check_state: std_atomic, - pub gc_state: std_atomic, - pub in_pure_callback: i16, - 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: jl_gc_tls_states_t, - pub gc_tls_common: jl_gc_tls_states_common_t, - pub defer_signal: sig_atomic_t, - pub current_task: u64, - pub next_task: *mut _jl_task_t, - pub previous_task: *mut _jl_task_t, - pub root_task: *mut _jl_task_t, - pub timing_stack: *mut _jl_timing_block_t, - pub stackbase: *mut ::std::os::raw::c_void, - pub stacksize: usize, - pub sig_exception: *mut _jl_value_t, - pub bt_data: *mut _jl_bt_element_t, - pub bt_size: usize, - pub profiling_bt_buffer: *mut _jl_bt_element_t, - pub signal_request: std_atomic, - pub io_wait: sig_atomic_t, - pub signal_stack: *mut ::std::os::raw::c_void, - pub signal_stack_size: usize, - pub system_id: jl_thread_t, - pub suspend_count: std_atomic, - pub finalizers: arraylist_t, - pub previous_exception: *mut _jl_value_t, - pub locks: small_arraylist_t, - pub engine_nqueued: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_tls_states_t"][::std::mem::size_of::<_jl_tls_states_t>() - 4288usize]; - ["Alignment of _jl_tls_states_t"][::std::mem::align_of::<_jl_tls_states_t>() - 64usize]; - ["Offset of field: _jl_tls_states_t::tid"] - [::std::mem::offset_of!(_jl_tls_states_t, tid) - 0usize]; - ["Offset of field: _jl_tls_states_t::threadpoolid"] - [::std::mem::offset_of!(_jl_tls_states_t, threadpoolid) - 2usize]; - ["Offset of field: _jl_tls_states_t::rngseed"] - [::std::mem::offset_of!(_jl_tls_states_t, rngseed) - 8usize]; - ["Offset of field: _jl_tls_states_t::safepoint"] - [::std::mem::offset_of!(_jl_tls_states_t, safepoint) - 16usize]; - ["Offset of field: _jl_tls_states_t::sleep_check_state"] - [::std::mem::offset_of!(_jl_tls_states_t, sleep_check_state) - 24usize]; - ["Offset of field: _jl_tls_states_t::gc_state"] - [::std::mem::offset_of!(_jl_tls_states_t, gc_state) - 25usize]; - ["Offset of field: _jl_tls_states_t::in_pure_callback"] - [::std::mem::offset_of!(_jl_tls_states_t, in_pure_callback) - 26usize]; - ["Offset of field: _jl_tls_states_t::in_finalizer"] - [::std::mem::offset_of!(_jl_tls_states_t, in_finalizer) - 28usize]; - ["Offset of field: _jl_tls_states_t::disable_gc"] - [::std::mem::offset_of!(_jl_tls_states_t, disable_gc) - 30usize]; - ["Offset of field: _jl_tls_states_t::finalizers_inhibited"] - [::std::mem::offset_of!(_jl_tls_states_t, finalizers_inhibited) - 32usize]; - ["Offset of field: _jl_tls_states_t::gc_tls"] - [::std::mem::offset_of!(_jl_tls_states_t, gc_tls) - 64usize]; - ["Offset of field: _jl_tls_states_t::gc_tls_common"] - [::std::mem::offset_of!(_jl_tls_states_t, gc_tls_common) - 2560usize]; - ["Offset of field: _jl_tls_states_t::defer_signal"] - [::std::mem::offset_of!(_jl_tls_states_t, defer_signal) - 3792usize]; - ["Offset of field: _jl_tls_states_t::current_task"] - [::std::mem::offset_of!(_jl_tls_states_t, current_task) - 3800usize]; - ["Offset of field: _jl_tls_states_t::next_task"] - [::std::mem::offset_of!(_jl_tls_states_t, next_task) - 3808usize]; - ["Offset of field: _jl_tls_states_t::previous_task"] - [::std::mem::offset_of!(_jl_tls_states_t, previous_task) - 3816usize]; - ["Offset of field: _jl_tls_states_t::root_task"] - [::std::mem::offset_of!(_jl_tls_states_t, root_task) - 3824usize]; - ["Offset of field: _jl_tls_states_t::timing_stack"] - [::std::mem::offset_of!(_jl_tls_states_t, timing_stack) - 3832usize]; - ["Offset of field: _jl_tls_states_t::stackbase"] - [::std::mem::offset_of!(_jl_tls_states_t, stackbase) - 3840usize]; - ["Offset of field: _jl_tls_states_t::stacksize"] - [::std::mem::offset_of!(_jl_tls_states_t, stacksize) - 3848usize]; - ["Offset of field: _jl_tls_states_t::sig_exception"] - [::std::mem::offset_of!(_jl_tls_states_t, sig_exception) - 3856usize]; - ["Offset of field: _jl_tls_states_t::bt_data"] - [::std::mem::offset_of!(_jl_tls_states_t, bt_data) - 3864usize]; - ["Offset of field: _jl_tls_states_t::bt_size"] - [::std::mem::offset_of!(_jl_tls_states_t, bt_size) - 3872usize]; - ["Offset of field: _jl_tls_states_t::profiling_bt_buffer"] - [::std::mem::offset_of!(_jl_tls_states_t, profiling_bt_buffer) - 3880usize]; - ["Offset of field: _jl_tls_states_t::signal_request"] - [::std::mem::offset_of!(_jl_tls_states_t, signal_request) - 3888usize]; - ["Offset of field: _jl_tls_states_t::io_wait"] - [::std::mem::offset_of!(_jl_tls_states_t, io_wait) - 3892usize]; - ["Offset of field: _jl_tls_states_t::signal_stack"] - [::std::mem::offset_of!(_jl_tls_states_t, signal_stack) - 3896usize]; - ["Offset of field: _jl_tls_states_t::signal_stack_size"] - [::std::mem::offset_of!(_jl_tls_states_t, signal_stack_size) - 3904usize]; - ["Offset of field: _jl_tls_states_t::system_id"] - [::std::mem::offset_of!(_jl_tls_states_t, system_id) - 3912usize]; - ["Offset of field: _jl_tls_states_t::suspend_count"] - [::std::mem::offset_of!(_jl_tls_states_t, suspend_count) - 3920usize]; - ["Offset of field: _jl_tls_states_t::finalizers"] - [::std::mem::offset_of!(_jl_tls_states_t, finalizers) - 3928usize]; - ["Offset of field: _jl_tls_states_t::previous_exception"] - [::std::mem::offset_of!(_jl_tls_states_t, previous_exception) - 4184usize]; - ["Offset of field: _jl_tls_states_t::locks"] - [::std::mem::offset_of!(_jl_tls_states_t, locks) - 4192usize]; - ["Offset of field: _jl_tls_states_t::engine_nqueued"] - [::std::mem::offset_of!(_jl_tls_states_t, engine_nqueued) - 4256usize]; -}; -pub type jl_value_t = _jl_value_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _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 _jl_taggedvalue_bits"][::std::mem::size_of::<_jl_taggedvalue_bits>() - 8usize]; - ["Alignment of _jl_taggedvalue_bits"][::std::mem::align_of::<_jl_taggedvalue_bits>() - 8usize]; -}; -impl _jl_taggedvalue_bits { - #[inline] - pub fn gc(&self) -> usize { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u64) } - } - #[inline] - pub fn set_gc(&mut self, val: usize) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 2u8, val as u64) - } - } - #[inline] - pub fn in_image(&self) -> usize { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } - } - #[inline] - pub fn set_in_image(&mut self, val: usize) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn unused(&self) -> usize { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } - } - #[inline] - pub fn set_unused(&mut self, val: usize) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn tag(&self) -> usize { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 60u8) as u64) } - } - #[inline] - pub fn set_tag(&mut self, val: usize) { - unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 60u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - gc: usize, - in_image: usize, - unused: usize, - tag: usize, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 2u8, { - let gc: u64 = unsafe { ::std::mem::transmute(gc) }; - gc as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let in_image: u64 = unsafe { ::std::mem::transmute(in_image) }; - in_image as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let unused: u64 = unsafe { ::std::mem::transmute(unused) }; - unused as u64 - }); - __bindgen_bitfield_unit.set(4usize, 60u8, { - let tag: u64 = unsafe { ::std::mem::transmute(tag) }; - tag as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _jl_taggedvalue_t { - pub __bindgen_anon_1: _jl_taggedvalue_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union _jl_taggedvalue_t__bindgen_ty_1 { - pub header: usize, - pub next: *mut jl_taggedvalue_t, - pub type_: *mut jl_value_t, - pub bits: _jl_taggedvalue_bits, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_taggedvalue_t__bindgen_ty_1"] - [::std::mem::size_of::<_jl_taggedvalue_t__bindgen_ty_1>() - 8usize]; - ["Alignment of _jl_taggedvalue_t__bindgen_ty_1"] - [::std::mem::align_of::<_jl_taggedvalue_t__bindgen_ty_1>() - 8usize]; - ["Offset of field: _jl_taggedvalue_t__bindgen_ty_1::header"] - [::std::mem::offset_of!(_jl_taggedvalue_t__bindgen_ty_1, header) - 0usize]; - ["Offset of field: _jl_taggedvalue_t__bindgen_ty_1::next"] - [::std::mem::offset_of!(_jl_taggedvalue_t__bindgen_ty_1, next) - 0usize]; - ["Offset of field: _jl_taggedvalue_t__bindgen_ty_1::type_"] - [::std::mem::offset_of!(_jl_taggedvalue_t__bindgen_ty_1, type_) - 0usize]; - ["Offset of field: _jl_taggedvalue_t__bindgen_ty_1::bits"] - [::std::mem::offset_of!(_jl_taggedvalue_t__bindgen_ty_1, bits) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_taggedvalue_t"][::std::mem::size_of::<_jl_taggedvalue_t>() - 8usize]; - ["Alignment of _jl_taggedvalue_t"][::std::mem::align_of::<_jl_taggedvalue_t>() - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_sym_t { - pub left: u64, - pub right: u64, - pub hash: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_sym_t"][::std::mem::size_of::<_jl_sym_t>() - 24usize]; - ["Alignment of _jl_sym_t"][::std::mem::align_of::<_jl_sym_t>() - 8usize]; - ["Offset of field: _jl_sym_t::left"][::std::mem::offset_of!(_jl_sym_t, left) - 0usize]; - ["Offset of field: _jl_sym_t::right"][::std::mem::offset_of!(_jl_sym_t, right) - 8usize]; - ["Offset of field: _jl_sym_t::hash"][::std::mem::offset_of!(_jl_sym_t, hash) - 16usize]; -}; -pub type jl_sym_t = _jl_sym_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_svec_t { - pub length: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_svec_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of jl_svec_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_svec_t::length"][::std::mem::offset_of!(jl_svec_t, length) - 0usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_genericmemory_t { - pub length: usize, - pub ptr: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_genericmemory_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of jl_genericmemory_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_genericmemory_t::length"] - [::std::mem::offset_of!(jl_genericmemory_t, length) - 0usize]; - ["Offset of field: jl_genericmemory_t::ptr"] - [::std::mem::offset_of!(jl_genericmemory_t, ptr) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_genericmemoryref_t { - pub ptr_or_offset: *mut ::std::os::raw::c_void, - pub mem: *mut jl_genericmemory_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_genericmemoryref_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of jl_genericmemoryref_t"] - [::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_genericmemoryref_t::ptr_or_offset"] - [::std::mem::offset_of!(jl_genericmemoryref_t, ptr_or_offset) - 0usize]; - ["Offset of field: jl_genericmemoryref_t::mem"] - [::std::mem::offset_of!(jl_genericmemoryref_t, mem) - 8usize]; -}; -#[repr(C)] -#[derive(Debug)] -pub struct jl_array_t { - pub ref_: jl_genericmemoryref_t, - pub dimsize: __IncompleteArrayField, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_array_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of jl_array_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_array_t::ref_"][::std::mem::offset_of!(jl_array_t, ref_) - 0usize]; - ["Offset of field: jl_array_t::dimsize"][::std::mem::offset_of!(jl_array_t, dimsize) - 16usize]; -}; -pub type jl_typemap_t = jl_value_t; -pub type jl_function_t = jl_value_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_typename_t { - pub name: *mut jl_sym_t, - pub module: *mut _jl_module_t, - pub names: *mut jl_svec_t, - pub atomicfields: *const u32, - pub constfields: *const u32, - pub wrapper: *mut jl_value_t, - pub Typeofwrapper: u64, - pub cache: u64, - pub linearcache: u64, - pub mt: *mut _jl_methtable_t, - pub partial: *mut jl_array_t, - pub hash: isize, - pub n_uninitialized: i32, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - pub max_methods: u8, - pub constprop_heustic: u8, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_typename_t"][::std::mem::size_of::() - 104usize]; - ["Alignment of jl_typename_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_typename_t::name"][::std::mem::offset_of!(jl_typename_t, name) - 0usize]; - ["Offset of field: jl_typename_t::module"] - [::std::mem::offset_of!(jl_typename_t, module) - 8usize]; - ["Offset of field: jl_typename_t::names"] - [::std::mem::offset_of!(jl_typename_t, names) - 16usize]; - ["Offset of field: jl_typename_t::atomicfields"] - [::std::mem::offset_of!(jl_typename_t, atomicfields) - 24usize]; - ["Offset of field: jl_typename_t::constfields"] - [::std::mem::offset_of!(jl_typename_t, constfields) - 32usize]; - ["Offset of field: jl_typename_t::wrapper"] - [::std::mem::offset_of!(jl_typename_t, wrapper) - 40usize]; - ["Offset of field: jl_typename_t::Typeofwrapper"] - [::std::mem::offset_of!(jl_typename_t, Typeofwrapper) - 48usize]; - ["Offset of field: jl_typename_t::cache"] - [::std::mem::offset_of!(jl_typename_t, cache) - 56usize]; - ["Offset of field: jl_typename_t::linearcache"] - [::std::mem::offset_of!(jl_typename_t, linearcache) - 64usize]; - ["Offset of field: jl_typename_t::mt"][::std::mem::offset_of!(jl_typename_t, mt) - 72usize]; - ["Offset of field: jl_typename_t::partial"] - [::std::mem::offset_of!(jl_typename_t, partial) - 80usize]; - ["Offset of field: jl_typename_t::hash"][::std::mem::offset_of!(jl_typename_t, hash) - 88usize]; - ["Offset of field: jl_typename_t::n_uninitialized"] - [::std::mem::offset_of!(jl_typename_t, n_uninitialized) - 96usize]; - ["Offset of field: jl_typename_t::max_methods"] - [::std::mem::offset_of!(jl_typename_t, max_methods) - 101usize]; - ["Offset of field: jl_typename_t::constprop_heustic"] - [::std::mem::offset_of!(jl_typename_t, constprop_heustic) - 102usize]; -}; -impl jl_typename_t { - #[inline] - pub fn abstract_(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } - } - #[inline] - pub fn set_abstract(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn mutabl(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } - } - #[inline] - pub fn set_mutabl(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn mayinlinealloc(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } - } - #[inline] - pub fn set_mayinlinealloc(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn _reserved(&self) -> u8 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 5u8) as u8) } - } - #[inline] - pub fn set__reserved(&mut self, val: u8) { - unsafe { - let val: u8 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 5u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - abstract_: u8, - mutabl: u8, - mayinlinealloc: u8, - _reserved: u8, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let abstract_: u8 = unsafe { ::std::mem::transmute(abstract_) }; - abstract_ as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let mutabl: u8 = unsafe { ::std::mem::transmute(mutabl) }; - mutabl as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let mayinlinealloc: u8 = unsafe { ::std::mem::transmute(mayinlinealloc) }; - mayinlinealloc as u64 - }); - __bindgen_bitfield_unit.set(3usize, 5u8, { - let _reserved: u8 = unsafe { ::std::mem::transmute(_reserved) }; - _reserved as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_datatype_layout_t { - pub size: u32, - pub nfields: u32, - pub npointers: u32, - pub first_ptr: i32, - pub alignment: u16, - pub flags: jl_datatype_layout_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_datatype_layout_t__bindgen_ty_1 { - pub _bitfield_align_1: [u16; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_datatype_layout_t__bindgen_ty_1"] - [::std::mem::size_of::() - 2usize]; - ["Alignment of jl_datatype_layout_t__bindgen_ty_1"] - [::std::mem::align_of::() - 2usize]; -}; -impl jl_datatype_layout_t__bindgen_ty_1 { - #[inline] - pub fn haspadding(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } - } - #[inline] - pub fn set_haspadding(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn fielddesc_type(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 2u8) as u16) } - } - #[inline] - pub fn set_fielddesc_type(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 2u8, val as u64) - } - } - #[inline] - pub fn arrayelem_isboxed(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } - } - #[inline] - pub fn set_arrayelem_isboxed(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn arrayelem_isunion(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } - } - #[inline] - pub fn set_arrayelem_isunion(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn isbitsegal(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } - } - #[inline] - pub fn set_isbitsegal(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn padding(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 10u8) as u16) } - } - #[inline] - pub fn set_padding(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 10u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - haspadding: u16, - fielddesc_type: u16, - arrayelem_isboxed: u16, - arrayelem_isunion: u16, - isbitsegal: u16, - padding: u16, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let haspadding: u16 = unsafe { ::std::mem::transmute(haspadding) }; - haspadding as u64 - }); - __bindgen_bitfield_unit.set(1usize, 2u8, { - let fielddesc_type: u16 = unsafe { ::std::mem::transmute(fielddesc_type) }; - fielddesc_type as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let arrayelem_isboxed: u16 = unsafe { ::std::mem::transmute(arrayelem_isboxed) }; - arrayelem_isboxed as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let arrayelem_isunion: u16 = unsafe { ::std::mem::transmute(arrayelem_isunion) }; - arrayelem_isunion as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let isbitsegal: u16 = unsafe { ::std::mem::transmute(isbitsegal) }; - isbitsegal as u64 - }); - __bindgen_bitfield_unit.set(6usize, 10u8, { - let padding: u16 = unsafe { ::std::mem::transmute(padding) }; - padding as u64 - }); - __bindgen_bitfield_unit - } -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_datatype_layout_t"][::std::mem::size_of::() - 20usize]; - ["Alignment of jl_datatype_layout_t"][::std::mem::align_of::() - 4usize]; - ["Offset of field: jl_datatype_layout_t::size"] - [::std::mem::offset_of!(jl_datatype_layout_t, size) - 0usize]; - ["Offset of field: jl_datatype_layout_t::nfields"] - [::std::mem::offset_of!(jl_datatype_layout_t, nfields) - 4usize]; - ["Offset of field: jl_datatype_layout_t::npointers"] - [::std::mem::offset_of!(jl_datatype_layout_t, npointers) - 8usize]; - ["Offset of field: jl_datatype_layout_t::first_ptr"] - [::std::mem::offset_of!(jl_datatype_layout_t, first_ptr) - 12usize]; - ["Offset of field: jl_datatype_layout_t::alignment"] - [::std::mem::offset_of!(jl_datatype_layout_t, alignment) - 16usize]; - ["Offset of field: jl_datatype_layout_t::flags"] - [::std::mem::offset_of!(jl_datatype_layout_t, flags) - 18usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_datatype_t { - pub name: *mut jl_typename_t, - pub super_: *mut _jl_datatype_t, - pub parameters: *mut jl_svec_t, - pub types: *mut jl_svec_t, - pub instance: *mut jl_value_t, - pub layout: *const jl_datatype_layout_t, - pub hash: u32, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, - pub __bindgen_padding_0: u16, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_datatype_t"][::std::mem::size_of::<_jl_datatype_t>() - 56usize]; - ["Alignment of _jl_datatype_t"][::std::mem::align_of::<_jl_datatype_t>() - 8usize]; - ["Offset of field: _jl_datatype_t::name"] - [::std::mem::offset_of!(_jl_datatype_t, name) - 0usize]; - ["Offset of field: _jl_datatype_t::super_"] - [::std::mem::offset_of!(_jl_datatype_t, super_) - 8usize]; - ["Offset of field: _jl_datatype_t::parameters"] - [::std::mem::offset_of!(_jl_datatype_t, parameters) - 16usize]; - ["Offset of field: _jl_datatype_t::types"] - [::std::mem::offset_of!(_jl_datatype_t, types) - 24usize]; - ["Offset of field: _jl_datatype_t::instance"] - [::std::mem::offset_of!(_jl_datatype_t, instance) - 32usize]; - ["Offset of field: _jl_datatype_t::layout"] - [::std::mem::offset_of!(_jl_datatype_t, layout) - 40usize]; - ["Offset of field: _jl_datatype_t::hash"] - [::std::mem::offset_of!(_jl_datatype_t, hash) - 48usize]; -}; -impl _jl_datatype_t { - #[inline] - pub fn hasfreetypevars(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } - } - #[inline] - pub fn set_hasfreetypevars(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn isconcretetype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } - } - #[inline] - pub fn set_isconcretetype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn isdispatchtuple(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) } - } - #[inline] - pub fn set_isdispatchtuple(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn isbitstype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } - } - #[inline] - pub fn set_isbitstype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn zeroinit(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } - } - #[inline] - pub fn set_zeroinit(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn has_concrete_subtype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) } - } - #[inline] - pub fn set_has_concrete_subtype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn maybe_subtype_of_cache(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) } - } - #[inline] - pub fn set_maybe_subtype_of_cache(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 1u8, val as u64) - } - } - #[inline] - pub fn isprimitivetype(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } - } - #[inline] - pub fn set_isprimitivetype(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(7usize, 1u8, val as u64) - } - } - #[inline] - pub fn ismutationfree(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) } - } - #[inline] - pub fn set_ismutationfree(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 1u8, val as u64) - } - } - #[inline] - pub fn isidentityfree(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) } - } - #[inline] - pub fn set_isidentityfree(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(9usize, 1u8, val as u64) - } - } - #[inline] - pub fn smalltag(&self) -> u16 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 6u8) as u16) } - } - #[inline] - pub fn set_smalltag(&mut self, val: u16) { - unsafe { - let val: u16 = ::std::mem::transmute(val); - self._bitfield_1.set(10usize, 6u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - hasfreetypevars: u16, - isconcretetype: u16, - isdispatchtuple: u16, - isbitstype: u16, - zeroinit: u16, - has_concrete_subtype: u16, - maybe_subtype_of_cache: u16, - isprimitivetype: u16, - ismutationfree: u16, - isidentityfree: u16, - smalltag: u16, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let hasfreetypevars: u16 = unsafe { ::std::mem::transmute(hasfreetypevars) }; - hasfreetypevars as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let isconcretetype: u16 = unsafe { ::std::mem::transmute(isconcretetype) }; - isconcretetype as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let isdispatchtuple: u16 = unsafe { ::std::mem::transmute(isdispatchtuple) }; - isdispatchtuple as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let isbitstype: u16 = unsafe { ::std::mem::transmute(isbitstype) }; - isbitstype as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let zeroinit: u16 = unsafe { ::std::mem::transmute(zeroinit) }; - zeroinit as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let has_concrete_subtype: u16 = unsafe { ::std::mem::transmute(has_concrete_subtype) }; - has_concrete_subtype as u64 - }); - __bindgen_bitfield_unit.set(6usize, 1u8, { - let maybe_subtype_of_cache: u16 = - unsafe { ::std::mem::transmute(maybe_subtype_of_cache) }; - maybe_subtype_of_cache as u64 - }); - __bindgen_bitfield_unit.set(7usize, 1u8, { - let isprimitivetype: u16 = unsafe { ::std::mem::transmute(isprimitivetype) }; - isprimitivetype as u64 - }); - __bindgen_bitfield_unit.set(8usize, 1u8, { - let ismutationfree: u16 = unsafe { ::std::mem::transmute(ismutationfree) }; - ismutationfree as u64 - }); - __bindgen_bitfield_unit.set(9usize, 1u8, { - let isidentityfree: u16 = unsafe { ::std::mem::transmute(isidentityfree) }; - isidentityfree as u64 - }); - __bindgen_bitfield_unit.set(10usize, 6u8, { - let smalltag: u16 = unsafe { ::std::mem::transmute(smalltag) }; - smalltag as u64 - }); - __bindgen_bitfield_unit - } -} -pub type jl_datatype_t = _jl_datatype_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_weakref_t { - pub value: *mut jl_value_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_weakref_t"][::std::mem::size_of::<_jl_weakref_t>() - 8usize]; - ["Alignment of _jl_weakref_t"][::std::mem::align_of::<_jl_weakref_t>() - 8usize]; - ["Offset of field: _jl_weakref_t::value"] - [::std::mem::offset_of!(_jl_weakref_t, value) - 0usize]; -}; -pub type jl_weakref_t = _jl_weakref_t; -pub type jl_ptr_kind_union_t = usize; -#[repr(C)] -#[derive(Debug)] -pub struct _jl_binding_partition_t { - pub restriction: std_atomic, - pub min_world: usize, - pub max_world: std_atomic, - pub next: u64, - pub reserved: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_binding_partition_t"][::std::mem::size_of::<_jl_binding_partition_t>() - 40usize]; - ["Alignment of _jl_binding_partition_t"] - [::std::mem::align_of::<_jl_binding_partition_t>() - 8usize]; - ["Offset of field: _jl_binding_partition_t::restriction"] - [::std::mem::offset_of!(_jl_binding_partition_t, restriction) - 0usize]; - ["Offset of field: _jl_binding_partition_t::min_world"] - [::std::mem::offset_of!(_jl_binding_partition_t, min_world) - 8usize]; - ["Offset of field: _jl_binding_partition_t::max_world"] - [::std::mem::offset_of!(_jl_binding_partition_t, max_world) - 16usize]; - ["Offset of field: _jl_binding_partition_t::next"] - [::std::mem::offset_of!(_jl_binding_partition_t, next) - 24usize]; - ["Offset of field: _jl_binding_partition_t::reserved"] - [::std::mem::offset_of!(_jl_binding_partition_t, reserved) - 32usize]; -}; -pub type jl_binding_partition_t = _jl_binding_partition_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct jl_uuid_t { - pub hi: u64, - pub lo: u64, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of jl_uuid_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of jl_uuid_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: jl_uuid_t::hi"][::std::mem::offset_of!(jl_uuid_t, hi) - 0usize]; - ["Offset of field: jl_uuid_t::lo"][::std::mem::offset_of!(jl_uuid_t, lo) - 8usize]; -}; -#[repr(C)] -#[derive(Debug)] -pub struct _jl_module_t { - pub name: *mut jl_sym_t, - pub parent: *mut _jl_module_t, - pub bindings: u64, - pub bindingkeyset: u64, - pub file: *mut jl_sym_t, - pub line: i32, - pub usings: arraylist_t, - pub build_id: jl_uuid_t, - pub uuid: jl_uuid_t, - pub counter: std_atomic, - pub nospecialize: i32, - pub optlevel: i8, - pub compile: i8, - pub infer: i8, - pub istopmod: u8, - pub max_methods: i8, - pub lock: jl_mutex_t, - pub hash: isize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_module_t"][::std::mem::size_of::<_jl_module_t>() - 376usize]; - ["Alignment of _jl_module_t"][::std::mem::align_of::<_jl_module_t>() - 8usize]; - ["Offset of field: _jl_module_t::name"][::std::mem::offset_of!(_jl_module_t, name) - 0usize]; - ["Offset of field: _jl_module_t::parent"] - [::std::mem::offset_of!(_jl_module_t, parent) - 8usize]; - ["Offset of field: _jl_module_t::bindings"] - [::std::mem::offset_of!(_jl_module_t, bindings) - 16usize]; - ["Offset of field: _jl_module_t::bindingkeyset"] - [::std::mem::offset_of!(_jl_module_t, bindingkeyset) - 24usize]; - ["Offset of field: _jl_module_t::file"][::std::mem::offset_of!(_jl_module_t, file) - 32usize]; - ["Offset of field: _jl_module_t::line"][::std::mem::offset_of!(_jl_module_t, line) - 40usize]; - ["Offset of field: _jl_module_t::usings"] - [::std::mem::offset_of!(_jl_module_t, usings) - 48usize]; - ["Offset of field: _jl_module_t::build_id"] - [::std::mem::offset_of!(_jl_module_t, build_id) - 304usize]; - ["Offset of field: _jl_module_t::uuid"][::std::mem::offset_of!(_jl_module_t, uuid) - 320usize]; - ["Offset of field: _jl_module_t::counter"] - [::std::mem::offset_of!(_jl_module_t, counter) - 336usize]; - ["Offset of field: _jl_module_t::nospecialize"] - [::std::mem::offset_of!(_jl_module_t, nospecialize) - 340usize]; - ["Offset of field: _jl_module_t::optlevel"] - [::std::mem::offset_of!(_jl_module_t, optlevel) - 344usize]; - ["Offset of field: _jl_module_t::compile"] - [::std::mem::offset_of!(_jl_module_t, compile) - 345usize]; - ["Offset of field: _jl_module_t::infer"] - [::std::mem::offset_of!(_jl_module_t, infer) - 346usize]; - ["Offset of field: _jl_module_t::istopmod"] - [::std::mem::offset_of!(_jl_module_t, istopmod) - 347usize]; - ["Offset of field: _jl_module_t::max_methods"] - [::std::mem::offset_of!(_jl_module_t, max_methods) - 348usize]; - ["Offset of field: _jl_module_t::lock"][::std::mem::offset_of!(_jl_module_t, lock) - 352usize]; - ["Offset of field: _jl_module_t::hash"][::std::mem::offset_of!(_jl_module_t, hash) - 368usize]; -}; -pub type jl_module_t = _jl_module_t; -#[repr(C)] -#[derive(Debug)] -pub struct _jl_methtable_t { - pub name: *mut jl_sym_t, - pub defs: u64, - pub leafcache: u64, - pub cache: u64, - pub max_args: std_atomic, - pub module: *mut jl_module_t, - pub backedges: *mut jl_array_t, - pub writelock: jl_mutex_t, - pub offs: u8, - pub frozen: u8, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_methtable_t"][::std::mem::size_of::<_jl_methtable_t>() - 80usize]; - ["Alignment of _jl_methtable_t"][::std::mem::align_of::<_jl_methtable_t>() - 8usize]; - ["Offset of field: _jl_methtable_t::name"] - [::std::mem::offset_of!(_jl_methtable_t, name) - 0usize]; - ["Offset of field: _jl_methtable_t::defs"] - [::std::mem::offset_of!(_jl_methtable_t, defs) - 8usize]; - ["Offset of field: _jl_methtable_t::leafcache"] - [::std::mem::offset_of!(_jl_methtable_t, leafcache) - 16usize]; - ["Offset of field: _jl_methtable_t::cache"] - [::std::mem::offset_of!(_jl_methtable_t, cache) - 24usize]; - ["Offset of field: _jl_methtable_t::max_args"] - [::std::mem::offset_of!(_jl_methtable_t, max_args) - 32usize]; - ["Offset of field: _jl_methtable_t::module"] - [::std::mem::offset_of!(_jl_methtable_t, module) - 40usize]; - ["Offset of field: _jl_methtable_t::backedges"] - [::std::mem::offset_of!(_jl_methtable_t, backedges) - 48usize]; - ["Offset of field: _jl_methtable_t::writelock"] - [::std::mem::offset_of!(_jl_methtable_t, writelock) - 56usize]; - ["Offset of field: _jl_methtable_t::offs"] - [::std::mem::offset_of!(_jl_methtable_t, offs) - 72usize]; - ["Offset of field: _jl_methtable_t::frozen"] - [::std::mem::offset_of!(_jl_methtable_t, frozen) - 73usize]; -}; -pub const jl_small_typeof_tags_jl_null_tag: jl_small_typeof_tags = 0; -pub const jl_small_typeof_tags_jl_typeofbottom_tag: jl_small_typeof_tags = 1; -pub const jl_small_typeof_tags_jl_datatype_tag: jl_small_typeof_tags = 2; -pub const jl_small_typeof_tags_jl_unionall_tag: jl_small_typeof_tags = 3; -pub const jl_small_typeof_tags_jl_uniontype_tag: jl_small_typeof_tags = 4; -pub const jl_small_typeof_tags_jl_vararg_tag: jl_small_typeof_tags = 5; -pub const jl_small_typeof_tags_jl_tvar_tag: jl_small_typeof_tags = 6; -pub const jl_small_typeof_tags_jl_symbol_tag: jl_small_typeof_tags = 7; -pub const jl_small_typeof_tags_jl_module_tag: jl_small_typeof_tags = 8; -pub const jl_small_typeof_tags_jl_simplevector_tag: jl_small_typeof_tags = 9; -pub const jl_small_typeof_tags_jl_string_tag: jl_small_typeof_tags = 10; -pub const jl_small_typeof_tags_jl_task_tag: jl_small_typeof_tags = 11; -pub const jl_small_typeof_tags_jl_bool_tag: jl_small_typeof_tags = 12; -pub const jl_small_typeof_tags_jl_char_tag: jl_small_typeof_tags = 13; -pub const jl_small_typeof_tags_jl_int16_tag: jl_small_typeof_tags = 14; -pub const jl_small_typeof_tags_jl_int32_tag: jl_small_typeof_tags = 15; -pub const jl_small_typeof_tags_jl_int64_tag: jl_small_typeof_tags = 16; -pub const jl_small_typeof_tags_jl_int8_tag: jl_small_typeof_tags = 17; -pub const jl_small_typeof_tags_jl_uint16_tag: jl_small_typeof_tags = 18; -pub const jl_small_typeof_tags_jl_uint32_tag: jl_small_typeof_tags = 19; -pub const jl_small_typeof_tags_jl_uint64_tag: jl_small_typeof_tags = 20; -pub const jl_small_typeof_tags_jl_uint8_tag: jl_small_typeof_tags = 21; -pub const jl_small_typeof_tags_jl_tags_count: jl_small_typeof_tags = 22; -pub const jl_small_typeof_tags_jl_bitstags_first: jl_small_typeof_tags = 13; -pub const jl_small_typeof_tags_jl_max_tags: jl_small_typeof_tags = 64; -pub type jl_small_typeof_tags = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_gcframe_t { - pub nroots: usize, - pub prev: *mut _jl_gcframe_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_gcframe_t"][::std::mem::size_of::<_jl_gcframe_t>() - 16usize]; - ["Alignment of _jl_gcframe_t"][::std::mem::align_of::<_jl_gcframe_t>() - 8usize]; - ["Offset of field: _jl_gcframe_t::nroots"] - [::std::mem::offset_of!(_jl_gcframe_t, nroots) - 0usize]; - ["Offset of field: _jl_gcframe_t::prev"][::std::mem::offset_of!(_jl_gcframe_t, prev) - 8usize]; -}; -pub type jl_timing_block_t = _jl_timing_block_t; -pub type jl_excstack_t = _jl_excstack_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_handler_t { - pub eh_ctx: sigjmp_buf, - pub gcstack: *mut jl_gcframe_t, - pub prev: *mut _jl_handler_t, - pub gc_state: i8, - pub locks_len: usize, - pub defer_signal: sig_atomic_t, - pub timing_stack: *mut jl_timing_block_t, - pub world_age: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_handler_t"][::std::mem::size_of::<_jl_handler_t>() - 256usize]; - ["Alignment of _jl_handler_t"][::std::mem::align_of::<_jl_handler_t>() - 8usize]; - ["Offset of field: _jl_handler_t::eh_ctx"] - [::std::mem::offset_of!(_jl_handler_t, eh_ctx) - 0usize]; - ["Offset of field: _jl_handler_t::gcstack"] - [::std::mem::offset_of!(_jl_handler_t, gcstack) - 200usize]; - ["Offset of field: _jl_handler_t::prev"] - [::std::mem::offset_of!(_jl_handler_t, prev) - 208usize]; - ["Offset of field: _jl_handler_t::gc_state"] - [::std::mem::offset_of!(_jl_handler_t, gc_state) - 216usize]; - ["Offset of field: _jl_handler_t::locks_len"] - [::std::mem::offset_of!(_jl_handler_t, locks_len) - 224usize]; - ["Offset of field: _jl_handler_t::defer_signal"] - [::std::mem::offset_of!(_jl_handler_t, defer_signal) - 232usize]; - ["Offset of field: _jl_handler_t::timing_stack"] - [::std::mem::offset_of!(_jl_handler_t, timing_stack) - 240usize]; - ["Offset of field: _jl_handler_t::world_age"] - [::std::mem::offset_of!(_jl_handler_t, world_age) - 248usize]; -}; -pub type jl_handler_t = _jl_handler_t; -#[repr(C)] -pub struct _jl_task_t { - pub next: *mut jl_value_t, - pub queue: *mut jl_value_t, - pub tls: *mut jl_value_t, - pub donenotify: *mut jl_value_t, - pub result: *mut jl_value_t, - pub scope: *mut jl_value_t, - pub start: *mut jl_function_t, - pub rngState: [u64; 5usize], - pub _state: std_atomic, - pub sticky: u8, - pub _isexception: std_atomic, - pub priority: u16, - pub tid: std_atomic, - pub threadpoolid: i8, - pub reentrant_timing: u8, - pub gcstack: *mut jl_gcframe_t, - pub world_age: usize, - pub ptls: jl_ptls_t, - pub excstack: *mut jl_excstack_t, - pub eh: *mut jl_handler_t, - pub ctx: jl_ucontext_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_task_t"][::std::mem::size_of::<_jl_task_t>() - 184usize]; - ["Alignment of _jl_task_t"][::std::mem::align_of::<_jl_task_t>() - 8usize]; - ["Offset of field: _jl_task_t::next"][::std::mem::offset_of!(_jl_task_t, next) - 0usize]; - ["Offset of field: _jl_task_t::queue"][::std::mem::offset_of!(_jl_task_t, queue) - 8usize]; - ["Offset of field: _jl_task_t::tls"][::std::mem::offset_of!(_jl_task_t, tls) - 16usize]; - ["Offset of field: _jl_task_t::donenotify"] - [::std::mem::offset_of!(_jl_task_t, donenotify) - 24usize]; - ["Offset of field: _jl_task_t::result"][::std::mem::offset_of!(_jl_task_t, result) - 32usize]; - ["Offset of field: _jl_task_t::scope"][::std::mem::offset_of!(_jl_task_t, scope) - 40usize]; - ["Offset of field: _jl_task_t::start"][::std::mem::offset_of!(_jl_task_t, start) - 48usize]; - ["Offset of field: _jl_task_t::rngState"] - [::std::mem::offset_of!(_jl_task_t, rngState) - 56usize]; - ["Offset of field: _jl_task_t::_state"][::std::mem::offset_of!(_jl_task_t, _state) - 96usize]; - ["Offset of field: _jl_task_t::sticky"][::std::mem::offset_of!(_jl_task_t, sticky) - 97usize]; - ["Offset of field: _jl_task_t::_isexception"] - [::std::mem::offset_of!(_jl_task_t, _isexception) - 98usize]; - ["Offset of field: _jl_task_t::priority"] - [::std::mem::offset_of!(_jl_task_t, priority) - 100usize]; - ["Offset of field: _jl_task_t::tid"][::std::mem::offset_of!(_jl_task_t, tid) - 102usize]; - ["Offset of field: _jl_task_t::threadpoolid"] - [::std::mem::offset_of!(_jl_task_t, threadpoolid) - 104usize]; - ["Offset of field: _jl_task_t::reentrant_timing"] - [::std::mem::offset_of!(_jl_task_t, reentrant_timing) - 105usize]; - ["Offset of field: _jl_task_t::gcstack"] - [::std::mem::offset_of!(_jl_task_t, gcstack) - 112usize]; - ["Offset of field: _jl_task_t::world_age"] - [::std::mem::offset_of!(_jl_task_t, world_age) - 120usize]; - ["Offset of field: _jl_task_t::ptls"][::std::mem::offset_of!(_jl_task_t, ptls) - 128usize]; - ["Offset of field: _jl_task_t::excstack"] - [::std::mem::offset_of!(_jl_task_t, excstack) - 136usize]; - ["Offset of field: _jl_task_t::eh"][::std::mem::offset_of!(_jl_task_t, eh) - 144usize]; - ["Offset of field: _jl_task_t::ctx"][::std::mem::offset_of!(_jl_task_t, ctx) - 152usize]; -}; -pub type jl_task_t = _jl_task_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _jl_bt_element_t { - pub __bindgen_anon_1: _jl_bt_element_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union _jl_bt_element_t__bindgen_ty_1 { - pub uintptr: usize, - pub jlvalue: *mut jl_value_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_bt_element_t__bindgen_ty_1"] - [::std::mem::size_of::<_jl_bt_element_t__bindgen_ty_1>() - 8usize]; - ["Alignment of _jl_bt_element_t__bindgen_ty_1"] - [::std::mem::align_of::<_jl_bt_element_t__bindgen_ty_1>() - 8usize]; - ["Offset of field: _jl_bt_element_t__bindgen_ty_1::uintptr"] - [::std::mem::offset_of!(_jl_bt_element_t__bindgen_ty_1, uintptr) - 0usize]; - ["Offset of field: _jl_bt_element_t__bindgen_ty_1::jlvalue"] - [::std::mem::offset_of!(_jl_bt_element_t__bindgen_ty_1, jlvalue) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_bt_element_t"][::std::mem::size_of::<_jl_bt_element_t>() - 8usize]; - ["Alignment of _jl_bt_element_t"][::std::mem::align_of::<_jl_bt_element_t>() - 8usize]; -}; -pub type jl_bt_element_t = _jl_bt_element_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_excstack_t { - pub top: usize, - pub reserved_size: usize, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of _jl_excstack_t"][::std::mem::size_of::<_jl_excstack_t>() - 16usize]; - ["Alignment of _jl_excstack_t"][::std::mem::align_of::<_jl_excstack_t>() - 8usize]; - ["Offset of field: _jl_excstack_t::top"][::std::mem::offset_of!(_jl_excstack_t, top) - 0usize]; - ["Offset of field: _jl_excstack_t::reserved_size"] - [::std::mem::offset_of!(_jl_excstack_t, reserved_size) - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _bigval_t { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_gc_pagemeta_t { - pub _address: u8, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_size_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_size_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _mallocmemory_t { - pub _address: u8, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_int64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_uint64_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_int8_t_close0"] - [::std::mem::size_of::>() - 1usize]; - ["Align of template specialization: std_atomic_open0_int8_t_close0"] - [::std::mem::align_of::>() - 1usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_int8_t_close0"] - [::std::mem::size_of::>() - 1usize]; - ["Align of template specialization: std_atomic_open0_int8_t_close0"] - [::std::mem::align_of::>() - 1usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jl_timing_block_t { - pub _address: u8, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_sig_atomic_t_close0"] - [::std::mem::size_of::>() - 4usize]; - ["Align of template specialization: std_atomic_open0_sig_atomic_t_close0"] - [::std::mem::align_of::>() - 4usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_int16_t_close0"] - [::std::mem::size_of::>() - 2usize]; - ["Align of template specialization: std_atomic_open0_int16_t_close0"] - [::std::mem::align_of::>() - 2usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_jl_ptr_kind_union_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_jl_ptr_kind_union_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_size_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_size_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_uint32_t_close0"] - [::std::mem::size_of::>() - 4usize]; - ["Align of template specialization: std_atomic_open0_uint32_t_close0"] - [::std::mem::align_of::>() - 4usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_intptr_t_close0"] - [::std::mem::size_of::>() - 8usize]; - ["Align of template specialization: std_atomic_open0_intptr_t_close0"] - [::std::mem::align_of::>() - 8usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_uint8_t_close0"] - [::std::mem::size_of::>() - 1usize]; - ["Align of template specialization: std_atomic_open0_uint8_t_close0"] - [::std::mem::align_of::>() - 1usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_uint8_t_close0"] - [::std::mem::size_of::>() - 1usize]; - ["Align of template specialization: std_atomic_open0_uint8_t_close0"] - [::std::mem::align_of::>() - 1usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of template specialization: std_atomic_open0_int16_t_close0"] - [::std::mem::size_of::>() - 2usize]; - ["Align of template specialization: std_atomic_open0_int16_t_close0"] - [::std::mem::align_of::>() - 2usize]; -}; From 9798604739b0e866472506e95796b258ed726dba Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 05:35:03 +0000 Subject: [PATCH 19/32] Updating julia_version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 2b851d97..0fe4a458 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/mmtk/julia.git" -julia_version = "c20ecb31d11a4ce7354d05ae5e49ffc91714901f" +julia_version = "4bf8f4582a18867826f4c005e72fadb109e5164f" [lib] crate-type = ["cdylib"] From 48c82a07c948dcc607b5e85b6b6857eed0b3071a Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 05:37:25 +0000 Subject: [PATCH 20/32] Adding build.rs --- mmtk/build.rs | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 mmtk/build.rs diff --git a/mmtk/build.rs b/mmtk/build.rs new file mode 100644 index 00000000..7428f03d --- /dev/null +++ b/mmtk/build.rs @@ -0,0 +1,70 @@ +extern crate bindgen; + +// Use bindgen to build Rust bindings for Julia + +fn main() { + // Use environment variable $JULIA_PATH that points to Julia folder + let julia_dir_key = "JULIA_PATH"; + let mmtk_dir_key = "MMTK_JULIA_DIR"; + + let (mmtk_dir, julia_dir) = match (std::env::var(mmtk_dir_key), std::env::var(julia_dir_key)) { + (Ok(mmtk_val), Ok(julia_val)) => (mmtk_val, julia_val), + _ => panic!("Must set {} and {}", julia_dir_key, mmtk_dir_key), + }; + + // running `make julia_version.h` in $JULIA_PATH/src to generate julia_version.h + std::process::Command::new("make") + .current_dir(format!("{}/src", julia_dir)) + .args(["julia_version.h"]) + .output() + .expect("failed to execute process"); + + // runing `make` in $JULIA_PATH/deps to generate $JULIA_PATH/usr/include, in particular libunwind.h + std::process::Command::new("make") + .current_dir(format!("{}/deps", julia_dir)) + .output() + .expect("failed to execute process"); + + let bindings = bindgen::Builder::default() + .header(format!("{}/src/julia.h", julia_dir)) + .header(format!("{}/src/julia_internal.h", julia_dir)) + // Including the paths to depending .h files + .clang_arg("-I") + .clang_arg(format!("{}/mmtk/api", mmtk_dir)) + .clang_arg("-I") + .clang_arg(format!("{}/src", julia_dir)) + .clang_arg("-I") + .clang_arg(format!("{}/src/support", julia_dir)) + .clang_arg("-I") + .clang_arg(format!("{}/usr/include", julia_dir)) + // all types that we generate bindings from + .allowlist_item("jl_datatype_layout_t") + .allowlist_item("jl_ucontext_t") + .allowlist_item("jl_small_typeof_tags") + .allowlist_item("jl_*_tag") + .allowlist_item("jl_svec_t") + .allowlist_item("jl_module_t") + .allowlist_item("jl_task_t") + .allowlist_item("jl_datatype_t") + .allowlist_item("jl_weakref_t") + .allowlist_item("jl_binding_partition_t") + .allowlist_item("jl_bt_element_t") + .allowlist_item("jl_taggedvalue_t") + .allowlist_item("MMTkMutatorContext") + // --opaque-type MMTkMutatorContext + .opaque_type("MMTkMutatorContext") + // compile using c++ + .clang_arg("-x") + .clang_arg("c++") + .clang_arg("-std=c++14") + // using MMTK types + .clang_arg("-DMMTK_GC") + // Finish the builder and generate the bindings. + .generate() + // Unwrap the Result and panic on failure. + .expect("Unable to generate bindings"); + + bindings + .write_to_file("src/julia_types.rs") + .expect("Couldn't write bindings!"); +} From 10fbc83332e5ffb9d8cc6c873489fc723c049d37 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 05:42:02 +0000 Subject: [PATCH 21/32] Exporting JULIA_PATH --- .github/scripts/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/common.sh b/.github/scripts/common.sh index 3325c1af..7b10c356 100644 --- a/.github/scripts/common.sh +++ b/.github/scripts/common.sh @@ -1,5 +1,5 @@ BINDING_PATH=$(realpath $(dirname "$0"))/../.. -JULIA_PATH=$BINDING_PATH/vm/julia +export JULIA_PATH=$BINDING_PATH/vm/julia RUSTUP_TOOLCHAIN=`cat $BINDING_PATH/mmtk/rust-toolchain` JULIA_TEST_ARGS='--check-bounds=yes --startup-file=no --depwarn=error' From 0862d067cfa38b7bcf3b330675a0be96a3f09b61 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 05:53:51 +0000 Subject: [PATCH 22/32] Adding architecture to see if it removes bindgen issues --- mmtk/build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mmtk/build.rs b/mmtk/build.rs index 7428f03d..eab5f46c 100644 --- a/mmtk/build.rs +++ b/mmtk/build.rs @@ -57,6 +57,9 @@ fn main() { .clang_arg("-x") .clang_arg("c++") .clang_arg("-std=c++14") + + // using X86-64 + .clang_arg("-march=x86-64") // using MMTK types .clang_arg("-DMMTK_GC") // Finish the builder and generate the bindings. From b1fd11e3c7ccad40f3cbc6be7a7fd54206254af8 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 06:00:56 +0000 Subject: [PATCH 23/32] One more try with --target=x86_64-pc-linux-gnu --- mmtk/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/build.rs b/mmtk/build.rs index eab5f46c..c51b1129 100644 --- a/mmtk/build.rs +++ b/mmtk/build.rs @@ -59,7 +59,7 @@ fn main() { .clang_arg("-std=c++14") // using X86-64 - .clang_arg("-march=x86-64") + .clang_arg("--target=x86_64-pc-linux-gnu") // using MMTK types .clang_arg("-DMMTK_GC") // Finish the builder and generate the bindings. From ee4911e9b509b338bbae383b570f80095b2090d2 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 23:30:50 +0000 Subject: [PATCH 24/32] Trying to set up tmate session to debug bingen issue --- .github/workflows/binding-tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index 64a68141..bf456a1e 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -22,6 +22,10 @@ jobs: - name: Build Julia (Debug) run: | ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} + - name: Setup tmate session + uses: udesou/action-tmate@v3 + with: + sudo: false - name: Style check run: | ./.github/scripts/ci-style.sh From b0b6d7e975b670e6aaa002a5e2cda1ccff035027 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 23:34:33 +0000 Subject: [PATCH 25/32] Typo --- .github/workflows/binding-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index bf456a1e..826f765b 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -23,7 +23,7 @@ jobs: run: | ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} - name: Setup tmate session - uses: udesou/action-tmate@v3 + uses: mxschmitt/action-tmate@v3 with: sudo: false - name: Style check From 8888772b71035c79b32ebc9f21533205b4bcf6bf Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 23:40:16 +0000 Subject: [PATCH 26/32] Adding tmate session before building Julia? --- .github/workflows/binding-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index 826f765b..e687bde7 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -19,13 +19,13 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh - - name: Build Julia (Debug) - run: | - ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 with: sudo: false + - name: Build Julia (Debug) + run: | + ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} - name: Style check run: | ./.github/scripts/ci-style.sh From efbd912f309d66b8d1f343c11720bade1a8064cd Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Oct 2024 23:42:04 +0000 Subject: [PATCH 27/32] Removing with sudo false --- .github/workflows/binding-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index e687bde7..70b46e72 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -21,8 +21,6 @@ jobs: ./.github/scripts/ci-setup.sh - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - with: - sudo: false - name: Build Julia (Debug) run: | ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} From d6c6bbe4228faffa0deb451349cd88c70a9b5c03 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 17 Oct 2024 01:54:03 +0000 Subject: [PATCH 28/32] Disable action-tmate and rm llvm-* before building mmtk (?) --- .github/scripts/ci-build.sh | 2 ++ .github/workflows/binding-tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index 8e23f7c9..a4c63bee 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -27,6 +27,8 @@ fi plan_feature=${plan,,} moving_feature=${is_moving,,} + +sudo rm -rf /usr/lib/llvm-1* cd $MMTK_JULIA_DIR/mmtk cargo build --features $plan_feature,$moving_feature $build_args diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index 70b46e72..796a8f83 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -19,8 +19,8 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 + # - name: Setup tmate session + # uses: mxschmitt/action-tmate@v3 - name: Build Julia (Debug) run: | ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} From 2ea56695b2b80e6315eae7f2847e3f136a8fa968 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 17 Oct 2024 01:58:24 +0000 Subject: [PATCH 29/32] Trying again --- .github/scripts/ci-build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index a4c63bee..3f3538b5 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -28,7 +28,10 @@ plan_feature=${plan,,} moving_feature=${is_moving,,} -sudo rm -rf /usr/lib/llvm-1* +# For some reason these cause issues with bindgen +sudo rm -rf /usr/lib/llvm-14 +sudo rm -rf /usr/lib/llvm-13 + cd $MMTK_JULIA_DIR/mmtk cargo build --features $plan_feature,$moving_feature $build_args From 7affec8434647b46558422749741814bde085097 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 17 Oct 2024 04:18:35 +0000 Subject: [PATCH 30/32] Applying cargo fmt --- mmtk/build.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/mmtk/build.rs b/mmtk/build.rs index c51b1129..7428f03d 100644 --- a/mmtk/build.rs +++ b/mmtk/build.rs @@ -57,9 +57,6 @@ fn main() { .clang_arg("-x") .clang_arg("c++") .clang_arg("-std=c++14") - - // using X86-64 - .clang_arg("--target=x86_64-pc-linux-gnu") // using MMTK types .clang_arg("-DMMTK_GC") // Finish the builder and generate the bindings. From 480834e7f91893feb1bd7277f01baa05eb1d255f Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 17 Oct 2024 04:19:43 +0000 Subject: [PATCH 31/32] Remove commented code --- .github/workflows/binding-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index 796a8f83..64a68141 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -19,8 +19,6 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh - # - name: Setup tmate session - # uses: mxschmitt/action-tmate@v3 - name: Build Julia (Debug) run: | ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} From 3a397c968251f4cb60a81dd30584ff13975b41d9 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 18 Oct 2024 00:22:45 +0000 Subject: [PATCH 32/32] Updating emails --- .github/scripts/ci-build.sh | 5 ----- .github/workflows/binding-tests.yml | 12 ++++++++++++ mmtk/Cargo.toml | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index 3f3538b5..8e23f7c9 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -27,11 +27,6 @@ fi plan_feature=${plan,,} moving_feature=${is_moving,,} - -# For some reason these cause issues with bindgen -sudo rm -rf /usr/lib/llvm-14 -sudo rm -rf /usr/lib/llvm-13 - cd $MMTK_JULIA_DIR/mmtk cargo build --features $plan_feature,$moving_feature $build_args diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index 64a68141..8851e4f3 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -19,6 +19,9 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh + # removing these as they cause a conflict within bindgen + sudo rm -rf /usr/lib/llvm-14 + sudo rm -rf /usr/lib/llvm-13 - name: Build Julia (Debug) run: | ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} @@ -35,6 +38,9 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh + # removing these as they cause a conflict within bindgen + sudo rm -rf /usr/lib/llvm-14 + sudo rm -rf /usr/lib/llvm-13 - name: Patching unsupported tests run: | ./.github/scripts/ci-test-patching.sh @@ -54,6 +60,9 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh + # removing these as they cause a conflict within bindgen + sudo rm -rf /usr/lib/llvm-14 + sudo rm -rf /usr/lib/llvm-13 - name: Patching unsupported tests run: | ./.github/scripts/ci-test-patching.sh @@ -73,6 +82,9 @@ jobs: run: | ./.github/scripts/ci-checkout.sh ./.github/scripts/ci-setup.sh + # removing these as they cause a conflict within bindgen + sudo rm -rf /usr/lib/llvm-14 + sudo rm -rf /usr/lib/llvm-13 - name: Build Julia (Release) run: | ./.github/scripts/ci-build.sh release ${{ inputs.gc_plan }} ${{ inputs.moving }} diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 0fe4a458..d7db4535 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "mmtk-julia" version = "0.1.0" -authors = ["Eduardo Souza ", "Yi Lin "] +authors = ["Eduardo Souza ", "Yi Lin "] build = "build.rs" edition = "2018"