Skip to content

Instantly share code, notes, and snippets.

View gnawux's full-sized avatar
🚴‍♂️
Focusing

Xu Wang gnawux

🚴‍♂️
Focusing
View GitHub Profile
@gnawux
gnawux / spectre.c
Created January 6, 2018 03:59 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif