[go: up one dir, main page]

Today I Learned

2022/05/03

terraform tf aws

aws policy documents can change the order of items within permissions arrays, but that’s safe to ignore:

Also, that & types take 8 bytes = 64 bits on 64-bit systems

use std::mem;

pub struct Foo {
    bar: String, // 24
    baz: usize, // 8
}

pub struct Quux<'a> {
    foo: &'a Foo,
    bar: usize,
}

fn main() {
    println!("Foo: {}", mem::size_of::<Foo>()); // 32
    println!("&Foo: {}", mem::size_of::<&Foo>()); // 8 -- a pointer?
    println!("Quux: {}", mem::size_of::<Quux>()); // 16 -- a pointer + a usize!
    println!("&Quux: {}", mem::size_of::<&Quux>()); // 8 -- another pointer
}