Skip to content

Instantly share code, notes, and snippets.

def build(bld):
my_includes = [str(bld.env.LIBMTE),
str(bld.env.LIBMICROHTTPD)+'/include',
str(bld.env.LIBZMQ)+'/include']
protocc_full_path = os.path.join(bld.env.PROTOBUFC,"bin","protoc-c")
bld(rule="%s ${SRC} -I../src --c_out=src/" % protocc_full_path, source="src/admin.proto", target=["src/admin.pb-c.c", "src/admin.pb-c.h"])
bld(
#! /usr/bin/env python
# encoding: utf-8
import os
from Configure import conf
import Options
APPNAME='args'
VERSION='1.0.0'
@mkevac
mkevac / gist:3018264
Created June 29, 2012 14:27
Speed test
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#define HOWMUCH 100000000
#define RANDOMBITS 4
static uint64_t stats[32];
static uint64_t stats2[32];
marko@marko-virtual ~/badoo/temp $ gcc builtin_test.c -o test -O3 --std=gnu99
marko@marko-virtual ~/badoo/temp $ ./test
generating flags... 5 s
using cycle... 8 s
11929711 11926960 11926934 11925219 11928833 11923393 11923177
11924621 11924564 11928647 11921652 11924644 11926105 11929288
11929690 11924292 11923555 11922419 11925611 11924387 11928793
11926351 11928699 11927228 11922918 11921752 11927864 11926735
11927322 11923573 11932816 11930695
using builtin... 1 s
<?php
if (!extension_loaded('pcntl')) {
if (!dl('pcntl.so')) {
Error::add(ER_ERR.'-xxxx-'.__CLASS__, 'unable to load pcntl extension', NULL, NULL, __LINE__);
}
}
for ($i = 0; $i < 20; $i++) {
$pid = pcntl_fork();
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index 6f07731a49..30d64531db 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -587,7 +587,7 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
}
// Charge the allocation against the G. We'll account
// for internal fragmentation at the end of mallocgc.
- assistG.gcAssistBytes -= int64(size)
+ assistG.gcAssistBytes = 1024
diff --git a/gophersearch/search/search.go b/gophersearch/search/search.go
index e1441979..4dbc4276 100644
--- a/gophersearch/search/search.go
+++ b/gophersearch/search/search.go
@@ -3,6 +3,7 @@ package search
import (
"badoo/gophersearch/geo"
"badoo/gophersearch/user"
+
"github.com/davidreynolds/gos2/s2"
diff --git a/src/importer.c b/src/importer.c
index bf005b19..ef68bd5a 100644
--- a/src/importer.c
+++ b/src/importer.c
@@ -74,7 +74,7 @@ static int importer___user_add(struct importer_s *importer, struct user_s **u_,
return 0;
}
- if (0 > user_item_allocate(u_, user->n_custom_parameters)) {
+ if (0 > user_item_allocate(u_)) {
diff --git a/src/importer.c b/src/importer.c
index bf005b19..ef68bd5a 100644
--- a/src/importer.c
+++ b/src/importer.c
@@ -74,7 +74,7 @@ static int importer___user_add(struct importer_s *importer, struct user_s **u_,
return 0;
}
- if (0 > user_item_allocate(u_, user->n_custom_parameters)) {
+ if (0 > user_item_allocate(u_)) {
diff --git a/src/importer.c b/src/importer.c
index bf005b19..ef68bd5a 100644
--- a/src/importer.c
+++ b/src/importer.c
@@ -74,7 +74,7 @@ static int importer___user_add(struct importer_s *importer, struct user_s **u_,
return 0;
}
- if (0 > user_item_allocate(u_, user->n_custom_parameters)) {
+ if (0 > user_item_allocate(u_)) {