This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use json::parse; | |
use std::fs::read_to_string; | |
fn generate_array(arr: [u16; 256], name: &str) { | |
println!("const {name} = [_]u8 {{"); | |
for i in 0..256 / 16 { | |
print!(" "); | |
for j in 0..16 { | |
print!("{}, ", arr[i * 16 + j]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See in action https://godbolt.org/z/eYon5nWrP | |
extern void __assert_fn(void); | |
#define assert(e) do { if (!(e)) { __builtin_assume(!(e)); __assert_fn(); } } while (0); | |
static inline int nonpure_fn(void) | |
{ | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cell::UnsafeCell; | |
use std::ops::{Deref, DerefMut}; | |
use std::ptr; | |
use std::sync::atomic::{AtomicBool, AtomicPtr, Ordering}; | |
struct Node { | |
next: AtomicPtr<Node>, | |
locked: AtomicBool, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tmux new-session -d 'vim' | |
tmux split-window -v 'vim' | |
tmux -2 attach-session -d |