Skip to content

Instantly share code, notes, and snippets.

@1wilkens
1wilkens / check_versioned_symbols.py
Last active May 20, 2018 13:43
ring: util/check_versioned_symbols.py
#!/usr/bin/env python3
import os
import subprocess
import sys
INVALID_SYMBOLS = {
'_GLOBAL_OFFSET_TABLE_', 'stderr', 'stdout', 'fprintf', 'malloc', 'free',
'memset', 'memcpy', 'memcmp', 'memmove', 'syscall',
'DW.ref.rust_eh_personality', 'rust_eh_personality', '_Unwind_Resume'
### Keybase proof
I hereby claim:
* I am 1wilkens on github.
* I am 1wilkens (https://keybase.io/1wilkens) on keybase.
* I have a public key whose fingerprint is D742 E265 1E41 2C5C 52C7 656B 63D7 E08E EA4B 0CA3
To claim this, I am signing this object:
@1wilkens
1wilkens / Lifetimes in rust
Created January 28, 2014 10:57
I am not sure, how to allocate a vector use its fields in a struct I'm returning. My created vectors do not outlive the function call =/
pub struct GzipHeader<'a> {
id: &'a[u8], // length 2
c_meth: u8,
flags: GzipFlags,
m_time: &'a[u8], // length 4
ex_flags: GzipFlags,
os: u8
}
fn read_gzip_header<R: Reader>(r: bitio::BitReader<R>) -> GzipHeader {