MCPcopy Create free account
hub / github.com/Ruddle/Fomos / new

Method new

bootloader/kernel/src/app.rs:25–45  ·  view source on GitHub ↗
(
        log: extern "C" fn(*const u8, u32),
        fb: FBShare<'a>,
        calloc: extern "C" fn(usize, usize) -> *mut u8,
        cdalloc: extern "C" fn(*mut u8, usize, usize),
        input: &'a

Source from the content-addressed store, hash-verified

23static mut none: Option<Box<()>> = None;
24impl<'a> Context<'a> {
25 pub fn new(
26 log: extern "C" fn(*const u8, u32),
27 fb: FBShare<'a>,
28 calloc: extern "C" fn(usize, usize) -> *mut u8,
29 cdalloc: extern "C" fn(*mut u8, usize, usize),
30 input: &'a globals::Input,
31 ) -> Context<'a> {
32 let x = Context {
33 version: 1,
34 start_time: global_time_ms(),
35 log,
36 pid: 0,
37 fb,
38 calloc,
39 cdalloc,
40 store: unsafe { &mut none },
41 input,
42 };
43
44 return x;
45 }
46}
47
48type FuncType = extern "C" fn(arg: &mut Context) -> i32;

Callers

nothing calls this directly

Calls 4

global_time_msFunction · 0.85
clearMethod · 0.80
allocMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected