Skip to content

Instantly share code, notes, and snippets.

// -*-c++-*-
#ifndef AF_ALLOCATOR_ADAPTOR_H_
#define AF_ALLOCATOR_ADAPTOR_H_
#include "af/allocator_interface.h"
#include <memory>
namespace af {
// -*-c++-*-
#ifndef TRIVIAL_ALLOCATOR_H_
#define TRIVIAL_ALLOCATOR_H_
#include <cstdlib>
#include <climits>
namespace af {
// -*-c++-*-
#ifndef TRIVIAL_ALLOCATOR_H_
#define TRIVIAL_ALLOCATOR_H_
#include <cstdlib>
#include <cassert>
#include <cstdint>
namespace af {
#include <stdexcept>
#include <iostream>
#include "circular_buffer.h"
/*
Valgrind output:
alex@mars:~/dev/circular-buffer$ valgrind --leak-check=yes ./circular_buffer_test
==21141== Memcheck, a memory error detector
==21141== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
#!/usr/bin/python
import sys, re
GETTER_REGEX = 'public (String|long|int|double) (get[^\(]+)'
LEADING_SPACES = ' '
def jmxify(file_name):
"""Add JMX getter annotations to all public methods"""
#use "topfind"
#thread
#require "core"
#require "pcre"
open Core.Std
module Unix = Caml.UnixLabels
let format_line line time =
let t = Unix.gmtime time in
#!/usr/bin/perl -w
use strict;
use warnings;
use POSIX;
sub main {
if(@ARGV < 3) {
die "Usage: $0 pattern seconds output";
<store>
<name>test</name>
<persistence>bdb</persistence>
<routing>client</routing>
<replication-factor>2</replication-factor>
<required-reads>2</required-reads>
<required-writes>2</required-writes>
<key-serializer>
<type>string</type>
</key-serializer>
JVM_SIZE="-server -Xms18g -Xmx18g"
# New Generation Sizes (-XX:NewSize -XX:MaxNewSize)
JVM_SIZE_NEW="-XX:NewSize=2048m -XX:MaxNewSize=2048m"
# Type of Garbage Collector to use
JVM_GC_TYPE="-XX:+UseConcMarkSweepGC -XX:+UseParNewGC"
# Tuning options for the above garbage collector
JVM_GC_OPTS="-XX:CMSInitiatingOccupancyFraction=70 -XX:SurvivorRatio=2"
(global-set-key [(control c)(\#)] 'toggle-comment-current-line-or-region)
(global-set-key [(meta z)] 'repeat)
(global-set-key [(meta g)] 'goto-lne)
(global-set-key [(control c)(g)] 'goto-line)
(global-set-key [(control c)(control g)] 'goto-line)
(defun bind-autoindent ()
(local-set-key "\r" 'indent-newline-and-indent))
(defun indent-if-blank ()