Skip to content

Instantly share code, notes, and snippets.

View gchatelet's full-sized avatar

Guillaume Chatelet gchatelet

  • Google
  • Paris, France
View GitHub Profile
################ Unified Information ################
Vendor: GenuineIntel
Brand: Intel(R) Atom(TM) CPU 230 @ 1.60GHz
Cores per CPU: 1
Threads per CPU: 2
------------------ TLB Information ------------------
Instruction TLB:
- - - - - ITLB1: - - - - - - - - - - - - - - - - - -
Page size = 4 KB
Pages count = 32
################ Unified Information ################
Cores per CPU = 4
Threads per CPU = 8
------------------ TLB Information ------------------
Instruction TLB:
- - - - - ITLB1: - - - - - - - - - - - - - - - - - -
Page size = 4 KB
Pages count = 64
Pages count = 64
Associativity: 8-way associative
@gchatelet
gchatelet / smallvector.d
Last active July 5, 2016 19:23
SmallVector
struct SmallVector(T, size_t SIZE)
{
private T[SIZE] small_buffer;
private T* begin_ptr;
private size_t size;
private size_t capacity = SIZE;
invariant
{
assert(capacity >= size);
@gchatelet
gchatelet / gist:a8a2c953c598a1eeaf84c9109064e828
Last active May 7, 2016 21:48
dmd / gdc / ldc assembler for putBlocks function for murmurhash3 x86_64
Code is here:
https://github.com/gchatelet/phobos/blob/murmurhash3/std/digest/murmurhash.d#L97
###############
## dmd putBlock
###############
000000000049e158 <_D3std6digest10murmurhash65__T9putBlocksTS3std6digest10murmurhash20SMurmurHash3_x64_128TG2mZ9putBlocksFNaNbNiNfKS3std6digest10murmurhash20SMurmurHash3_x64_128MxAG2mX9__lambda3FNaNbNiNeKS3std6digest10murmurhash20SMurmurHash3_x64_128MxAG2mXv>:
49e158: 48 83 ec 28 sub $0x28,%rsp
49e15c: 4c 89 24 24 mov %r12,(%rsp)
49e160: 4c 89 6c 24 08 mov %r13,0x8(%rsp)
import org.restlet.Application;
import org.restlet.Server;
import org.restlet.data.Protocol;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
public class SimpleServer extends Application {
public static void main(String[] args) throws Exception {
new Server(Protocol.HTTP, 8111, GreetingResource.class).start();
}
/*
* Pool.h
*
* Created on: Feb 12, 2013
* Author: Guillaume Chatelet
*/
#ifndef POOL_H_
#define POOL_H_
struct VertexPosUv0 {
glm::vec3 position;
glm::vec2 uv0;
VertexPosUv0(glm::vec3 pos) :
position(pos) {
}
VertexPosUv0(glm::vec3 pos, glm::vec2 uv0) :
position(pos), uv0(uv0) {
}
};
@gchatelet
gchatelet / gist:1330474
Created November 1, 2011 13:17
NULL definition within stddef.h
/* A null pointer constant. */
#if defined (_STDDEF_H) || defined (__need_NULL)
#undef NULL /* in case <stdio.h> has defined it. */
#ifdef __GNUG__
#define NULL __null
#else /* G++ */
#ifndef __cplusplus
#define NULL ((void *)0)
#else /* C++ */
@gchatelet
gchatelet / gist:1330473
Created November 1, 2011 13:17
NULL definition within stddef.h
/* A null pointer constant. */
#if defined (_STDDEF_H) || defined (__need_NULL)
#undef NULL /* in case <stdio.h> has defined it. */
#ifdef __GNUG__
#define NULL __null
#else /* G++ */
#ifndef __cplusplus
#define NULL ((void *)0)
#else /* C++ */
// DO NOT EDIT MANUALLY
// This code is autogenerated.
// Have a look at test/cpp_mangling_tools/README.md for more informations.
import core.stdc.config;
version(linux):
static if(ptrdiff_t.sizeof == 8): // Only for 64 bits systems
struct S {}