Skip to content

Instantly share code, notes, and snippets.

View anton-povarov's full-sized avatar

Anton Povarov anton-povarov

  • Badoo
  • Moscow, Russia
View GitHub Profile
#include <assert.h>
#include <stdio.h>
#include <pthread.h>
#include <nanomsg/nn.h>
#include <nanomsg/reqrep.h>
static char* endpoint = "inproc://test";
void* thread_func(void *ctx)
package main
import (
"encoding/binary"
"fmt"
"github.com/coocood/freecache"
"github.com/davecheney/profile"
"log"
"math/rand"
"runtime"
@anton-povarov
anton-povarov / gist:6a3733d77da9ac837ba9
Created May 12, 2015 19:08
Bench code for #48 map vs bitmask
package main
import (
"fmt"
"math/rand"
"testing"
"time"
)
import proto "github.com/gogo/protobuf/proto"
@anton-povarov
anton-povarov / gist:c485ded98b51cb6605a0
Created May 12, 2015 18:29
gogo/protobuf pull #48 fix
diff --git a/plugin/unmarshal/unmarshal.go b/plugin/unmarshal/unmarshal.go
index ef232d0..ffafc65 100644
--- a/plugin/unmarshal/unmarshal.go
+++ b/plugin/unmarshal/unmarshal.go
@@ -685,24 +685,21 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
}
p.atleastOne = true
- // Count the required fields
- var rfList []string
@anton-povarov
anton-povarov / gist:eb7d4a01af4163487c1a
Created June 3, 2014 15:49
patch for ziutek/mymysql race
diff --git a/native/packet.go b/native/packet.go
index 6fc606e..a2609c5 100644
--- a/native/packet.go
+++ b/native/packet.go
@@ -107,9 +107,31 @@ func (pr *pktReader) readAll() (buf []byte) {
return
}
-var skipBuf [4069]byte
+//var skipBuf [4069]byte
package main
import (
"io"
"log"
"os"
"os/signal"
"syscall"
"time"