#[repr(C)]pub struct HostTable {Show 14 fields
pub size: u32,
pub version: u32,
pub cpu: u32,
pub threads: u32,
pub alloc: extern "win64" fn(size: usize, align: usize, zeroed: u32) -> *mut u8,
pub free: extern "win64" fn(p: *mut u8, size: usize, align: usize),
pub parallel_for: extern "win64" fn(count: usize, ctx: *const c_void, item: ItemFn) -> u32,
pub job_cancel: extern "win64" fn(job: *const c_void),
pub job_cancelled: extern "win64" fn(job: *const c_void) -> u32,
pub thr_count: extern "win64" fn() -> u32,
pub thr_self: extern "win64" fn() -> usize,
pub yield_now: extern "win64" fn(),
pub log: extern "win64" fn(msg: *const u8, len: usize),
pub panic: extern "win64" fn(msg: *const u8, len: usize) -> !,
}Expand description
the host’s functions (the module keeps the pointer)
Fields§
§size: u32§version: u32§cpu: u32§threads: u32§alloc: extern "win64" fn(size: usize, align: usize, zeroed: u32) -> *mut u8a block of size bytes aligned to align from the host’s allocator (zeroed != 0:
cleared), null when out of memory
free: extern "win64" fn(p: *mut u8, size: usize, align: usize)free a block of alloc with its size and alignment
parallel_for: extern "win64" fn(count: usize, ctx: *const c_void, item: ItemFn) -> u32item(ctx, i, job) for i in 0..count on the pool; 0 = done, 1 = cancelled
job_cancel: extern "win64" fn(job: *const c_void)job.cancel() of the job an item got
job_cancelled: extern "win64" fn(job: *const c_void) -> u32job.cancelled()
thr_count: extern "win64" fn() -> u32the pool’s thr_count() / thr_self()
thr_self: extern "win64" fn() -> usize§yield_now: extern "win64" fn()give the time slice away (spin locks)
log: extern "win64" fn(msg: *const u8, len: usize)one line on stderr (“
panic: extern "win64" fn(msg: *const u8, len: usize) -> !a panic of the module (UTF-8 message): the host’s crash report, exit code 3
Auto Trait Implementations§
impl Forget for HostTable
impl Freeze for HostTable
impl Move for HostTable
impl RefUnwindSafe for HostTable
impl Send for HostTable
impl Sync for HostTable
impl Unpin for HostTable
impl UnsafeUnpin for HostTable
impl UnwindSafe for HostTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more