Skip to content

Instantly share code, notes, and snippets.

View pnkfelix's full-sized avatar
re-pat; ex-🥐

Felix S Klock II pnkfelix

re-pat; ex-🥐
View GitHub Profile
pnkfelix /
Created January 29, 2018 14:04 — forked from anonymous/
mal-optimized instruction invocation
address instruction %rax %rcx %rdx %rdi %r12 %r14 %r15 rflags cs
0xffffffff80000000 0xffffffffffffffff 0xffffffffffffffff 0x0000000000000000 0x0000000000000017 0xffffffffffffffff 0x8000000000000000 0x000000000000002b
0x1066ccb36 <+12534> movq %r15, %rax 0x8000000000000000
0x1066ccb39 <+12537> addq $0x80, %rax 0x8000000000000080 0x0000000000000282
0x1066ccb3f <+12543> movq %r14, %rcx 0xffffffffffffffff
0x1066ccb42 <+12546> adcq $0x0, %rcx 0xffffffffffffffff 0x0000000000000286
0x1066ccb46 <+12550> cmpq $0x100, %rax 0x0000000000000a02
0x1066ccb4c <+12556> sbbq $0x0, %rcx 0xffffffffffffffff 0x0000000000000286
pnkfelix /
Last active October 29, 2015 17:34 — forked from anonymous/
Demo of a problem when panicking from within scoped_threadpool
#![cfg_attr(test, feature(catch_panic))]
extern crate scoped_threadpool;
use scoped_threadpool::Pool;
use std::sync::atomic::{AtomicUsize, Ordering};
// The representation invariant for PositivelyAtomic is that it is
// always a positive integer. When we drop it, we store zero in
// its value; but one should never observe that.