Skip to content

Instantly share code, notes, and snippets.

View dgryski's full-sized avatar
🏠
💻 🍞 ☕

Damian Gryski dgryski

🏠
💻 🍞 ☕
View GitHub Profile
@dgryski
dgryski / crasher-opt-0-dcmp.txt
Last active September 1, 2021 16:47
decompiled wasm and execution trace for https://github.com/tinygo-org/tinygo/issues/2041
export memory memory(initial: 2, max: 0);
global g_a:int = 65536;
table T_a:funcref(min: 12, max: 12);
data d_syncunlockofunlockedMutexinv(offset: 65536) =
"\08\00\01\00\1e\00\00\00sync: unlock of unlocked Mutexinvalid syntaxre"
"flect: call of reflect.Type. on invalid typeTreflect: call of reflect."
"Value. on invalid type/proc/self/exeout of memorypanic: runtime error:"
unit dvga;
{$G+} { generate 286 instructions -- needed for shl 6/8 }
{ for rect, should I inline the hline routine,
and convert the rest to asm? }
interface
const
maxx=319;
maxy=199;
.model tiny
.radix 16
.data
jmp start
;k1 dw 6255
;k2 dw 3619
k1 dw 24CD
k2 dw 1
seed dw ?
From: Ian Lance Taylor
After many discussions and reading many comments, we plan to move
forward with some changes and clarifications to the generics design
draft.
1.
We’re going to settle on square brackets for the generics syntax.
We’re going to drop the “type” keyword before type parameters, as
// +build gofuzz
package viaproxy
import (
"bytes"
"io"
"net"
)
@dgryski
dgryski / gist:a8353cb0977641f1feb6db1b8ed0eaf7
Created February 27, 2018 06:39
using the C pre-processor with Go
laptop:cppgo dgryski$ cat gen.go
package main
//go:generate cpp-7 -E -P foo.gopp foo.go
laptop:cppgo dgryski$ cat foo.gopp
package main
import "fmt"
#define STRINGIFY(x) #x
<dgryski@kamek[go] \ʕ◔ϖ◔ʔ/ > ag '// [A-Z]+(\([^\)]*\))?: ' |sed 's/.*\/\/ //; s/:.*//; s/(.*)/(username)/' |sort |uniq -c |sort -n
1 ARM
1 ASCII
1 BP
1 BX
1 CAVEAT
1 D
1 DATABUNDLE
1 DATABUNDLEEND
1 EXCEPT
package main
import (
"strings"
"testing"
)
var m = map[string]bool{"hello.goodbye": true}
func old(req string, filter map[string]bool) string {
BenchmarkKetama8-4 5000000 373 ns/op
BenchmarkKetama32-4 5000000 394 ns/op
BenchmarkKetama128-4 3000000 433 ns/op
BenchmarkKetama512-4 3000000 538 ns/op
BenchmarkKetama2048-4 2000000 672 ns/op
BenchmarkKetama8192-4 2000000 978 ns/op
BenchmarkChash8-4 10000000 129 ns/op
BenchmarkChash32-4 10000000 136 ns/op
BenchmarkChash128-4 10000000 220 ns/op
BenchmarkChash512-4 5000000 318 ns/op
<dgryski@kamek[w] \ʕ◔ϖ◔ʔ/ > cat main.go
package main
import "log"
type X struct {
body string
}
type Message interface {