Conversation

Charlotte 🦝 therian

on a scale from safe rust to c how cursed is my code [abridged]

let mut some_vec = Vec::with_capacity(128); // Hope we don’t need more!
unsafe { state.bork_global_allocator_and_logger_and_stdout(); }
some_vec.push(blah);
1
0
1

@charlotte@akko.chir.rs this looks fine since line 3 won't reallocate due to the reserved capacity on line 1 but what's with line 2 what's the point of doing that are you just trying to ruin everyone's day who wants to develop this?

1
0
0

@sodiboo line 2 is exiting the UEFI boot services, which i need to do before i start my kernel

1
0
1

@charlotte@akko.chir.rs I see. I have never touched kernel dev so I am probably not the best to judge the safety of this code. my official verdict is "​neocat_scream_scared​"

0
0
0