Skip to content

Instantly share code, notes, and snippets.

Alexis Beingessner Gankra

Block or report user

Report or block Gankra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View swiift-abi-2.md

% Swift and the Price of ABI Stability

For those who don't follow Swift's development, ABI stability has been one of its most ambitious projects, and it finally shipped in Swift 5. The result is something I find endlessly fascinating, because I think Swift has pushed the notion of ABI stability farther than any language with minimal compromise.

This article is broken up into two sections: background and details. Feel free to skip to the details if you're very comfortable with the problems inherent to producing a robust dynamically linked system interface.

If you aren't comfortable with the basic concepts of type layouts, ABIs, and calling conventions, I recommend reading the article I wrote on [the basic concepts of type layout and ABI as they pertain to Rust][rust-abi].

View layer-dump.txt
Painting --- compositing layer tree:
LayerManager (0x164ce420400) --- in 3D-sorted rendering order
ContainerLayerMLGPU (0x164c4441800) [shadow-visible=< (x=0, y=0, w=3205, h=2017); (x=0, y=2017, w=3162, h=4826); >] [visible=< (x=0, y=0, w=3205, h=2016); >] [opaqueContent] [metrics0={ [metrics={ [cb=(x=0.000000, y=0.000000, w=3205.000000, h=2016.000000)] [sr=(x=0.000000, y=0.000000, w=1282.000000, h=806.400024)] [s=(0,0)] [dp=(x=0.000000, y=0.000000, w=1282.000000, h=806.400024)] [cdp=(x=0.000000, y=0.000000, w=0.000000, h=0.000000)] [scrollId=3] [z=2.5] }] [color=rgba(0, 0, 0, 0.000000)] }] [presShellResolution=1]
PaintedLayerMLGPU (0x164c4445800) [shadow-visible=< (x=0, y=0, w=3205, h=2016); >] [visible=< (x=0, y=0, w=3205, h=2016); >] { hitregion=< (x=0, y=0, w=3205, h=2016); > dispatchtocontentregion=< (x=100, y=2, w=2660, h=83); >} [opaqueContent] [valid=< (x=0, y=0, w=3205, h=2016); >]
ContentHost (0x164c440da60) [buffer-rect=(x=0, y=0, w=3205, h=2016)] [buffer-rotation=(0,0)]
ShmemTe
View gradient.rs
/// Generate a color ramp filling the indices in [start_idx, end_idx) and interpolating
/// from start_color to end_color.
fn fill_colors(
start_idx: usize,
end_idx: usize,
start_color: &PremultipliedColorF,
end_color: &PremultipliedColorF,
entries: &mut ArrayVec<[GradientDataEntry; GRADIENT_DATA_SIZE]>,
) {
debug_assert_eq!(start_idx, entries.len());
@Gankra
Gankra / speedrunning-faq.md
Last active Jun 28, 2019 — forked from 0xabad1dea/speedrunning-faq.md
Speedrunning FAQ/Glossary
View speedrunning-faq.md

Speedrunning FAQ/Glossary

by 0xabad1dea September 2018

You may notice a decidedly Nintendo bias to the examples. I can't change who I am.

What is Speedrunning?

Speedrunning is:

  • Completing a video game
View memory-initialization.md

My mental model of Initialization and Deinitialization:

This is kind've a brain dump of concepts, and does not necessarily represent a well-defined and minimized model. For instance, it's not clear to me if deinitialized memory is a "real" thing, or just a concept I like to have to think about dropped memory.

There are 3 (5) states a bit can have: uninit, init (0 or 1), deinit (0 or 1)

Freshly allocated memory is uninit. mem::unitialized() produces uninit.

Initializing memory makes it init with a definite value.

View test.rs
#[cfg(not(target_os = "freebsd"))]
#[repr(C)]
pub struct ContainsNoExternTy {
pub field: no_extern::NoExternTy,
}
#[cfg(target_os = "freebsd")]
#[repr(C)]
pub struct ContainsNoExternTy {
pub field: u64,
View test.html
<!DOCTYPE HTML>
<html reftest-async-scroll>
<head>
<style>
body {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
View clipping.rs
// **** This clip-chain correctly clips the content
ClipChain((
id: (3, (1, 10)),
parent: None,
), [
Clip(4, (1, 10)),// [0]
Clip(2, (1, 10)),// [1]
]),// [16]
View builder.rs
(
output_rect: ((0, 0), (2880, 1710)),
background_color: Some((
r: 1,
g: 1,
b: 1,
a: 1,
)),
root_pic_index: (1),
pending_retained_tiles: (
You can’t perform that action at this time.