Skip to main content

HostTable

Struct HostTable 

Source
#[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 u8

a 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) -> u32

item(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) -> u32

job.cancelled()

§thr_count: extern "win64" fn() -> u32

the 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 (“: msg”)

§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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.