This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
int main() | |
{ | |
const long page_size = sysconf(_SC_PAGESIZE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/ioctl.h> | |
#include <sys/mman.h> | |
#include <sys/syscall.h> | |
#include <linux/userfaultfd.h> | |
#include <unistd.h> | |
#define TARGET_PTR ((void *)0x700000000000UL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e; set -o pipefail | |
# Thanks to https://stackoverflow.com/a/246128 | |
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )" | |
cd ${SCRIPT_DIR} | |
[[ -z $1 ]] || ${SCRIPT_DIR}/build.sh $1 | |
# Now watch for file changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
# Ref: http://stackoverflow.com/a/6481016 | |
CORES=$(grep -c ^processor /proc/cpuinfo) | |
pushd ~/linux | |
make mrproper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
"math/rand" | |
"sort" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/devmapper/devmapper.go b/devmapper/devmapper.go | |
index eae4224..36fd985 100644 | |
--- a/devmapper/devmapper.go | |
+++ b/devmapper/devmapper.go | |
@@ -1,6 +1,7 @@ | |
package devmapper | |
/* | |
+#cgo CFLAGS: -D_FILE_OFFSET_BITS=64 | |
#cgo LDFLAGS: -L. -ldevmapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import runtime "runtime" | |
type Foo interface { | |
Bar() *interface { | |
Bar() *interface { | |
Bar() *interface { | |
Bar() DotDotDot | |
Baz() *interface { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import runtime "runtime" | |
type Foo interface { | |
Bar() *interface { | |
Bar() *interface { | |
Bar() DotDotDot | |
Baz() *interface { | |
Bar() DotDotDot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import runtime "runtime" | |
type Foo interface { | |
Bar() *interface { | |
Bar() DotDotDot | |
Baz() *interface { | |
Bar() DotDotDot | |
Baz() DotDotDot |