Skip to content

Instantly share code, notes, and snippets.

Avatar

Kris Mok rednaxelafx

View GitHub Profile
@BrendanEich
BrendanEich / gist:5753666
Created Jun 11, 2013
ES6 version of Peter Norvig's Sudoku solver originally written in Python
View gist:5753666
// XXX should be standard (and named clone, after Java?)
Object.prototype.copy = function () {
let o = {}
for (let i in this)
o[i] = this[i]
return o
}
// Containment testing for arrays and strings that should be coherent with their iterator.
Array.prototype.contains = String.prototype.contains = function (e) {
View hs_err_pid13265.log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f943ff492ad, pid=13265, tid=1116805440
#
# JRE version: 6.0_32-b05
# Java VM: OpenJDK (Taobao) 64-Bit Server VM (20.0-b12-internal mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J java.lang.Object.<init>()V
#
@Ninputer
Ninputer / gist:2967888
Created Jun 21, 2012 — forked from anonymous/gist:2967637
.NET 4.5 Disassembly
View gist:2967888
Program:
class Program
{
string myString;
private Program()
{
myString = "foo";
}
anonymous
anonymous / gist:2967637
Created Jun 21, 2012
.NET 4.5 Disassembly
View gist:2967637
Program:
class Program
{
string myString;
private Program()
{
myString = "foo";
}
View gist:2823121

CRubyのGCの構造改革

やりたいこと

以下の6つの機能を分離し、簡単に切り替えられるようにしたい。

  1. OSからのメモリアロケータ
  • OSからメモリアロケートする部分のAPI
  1. Rubyのヒープ管理
  • ヒープの設定を保持
@szegedi
szegedi / memoryPoolsHotSpot
Created Dec 13, 2011
names of MemoryManagerMXBean and MemoryPoolMXBean instances in HotSpot JVM
View memoryPoolsHotSpot
Table of names of MemoryManagerMXBean and MemoryPoolMXBean instances under
different GC algorithms in Oracle HotSpot VM. Memory managers list the pools
they manage in square brackets; memory pools show their maximum sizes for -Xmx200M setting.
$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
SerialGC:
@ytoshima
ytoshima / interp.dump.txt
Created Oct 22, 2011
A gdb macro which dumps java7 HotSpot JVM linux/32-bit interpreter codelets and an output
View interp.dump.txt
AbstractInterpreter::_code : StubQueue * = 0xb49150c0
_stub_buffer : 0xb6f7a6c0
_number_of_stubs: 0x103
Codelet @ 0xb6f7a6c0 128 -1 0xffffffff 0x10c81a1: "slow signature handler"
Dump of assembler code from 0xb6f7a6e0 to 0xb6f7a740:
0xb6f7a6e0: mov %esp,%ecx
0xb6f7a6e2: call 0xb6f7a6ec
0xb6f7a6e7: jmp 0xb6f7a73f
0xb6f7a6ec: push %ecx
0xb6f7a6ed: push %edi
@headius
headius / build.sh
Created Aug 16, 2011
Building the Hotspot compiler team's Hotspot branch alone
View build.sh
#!/bin/sh
# This script is for building the hsx/hotspot-comp branch in isolation.
#
# Prerequisites:
# * appropriate build tools
# * a working Sun Java 6 build (i.e. JDK6) is available at:
# HOME/java/re/j2se/1.6.0/latest/binaries/linux-[i586/amd64]
# * a working Sun Java 7 build (i.e. JDK7) is available at:
# HOME/java/re/j2se/1.7.0/latest/binaries/linux-[i586/amd64]
# HOME/java/re/j2se/1.7.0/promoted/latest/binaries/linux-[i586/amd64]
View gist:1108283
package com.headius.indy.examples;
import java.lang.invoke.MethodHandle;
import static java.lang.invoke.MethodHandles.*;
import static java.lang.invoke.MethodType.*;
import java.lang.invoke.MutableCallSite;
public class IndyLoop {
public static void main(String[] args) throws Throwable {
// method handle loop adds up numbers from 1 to args[0].to_i
View generic_restriction.fs
let inline name (x : ^T) = (^T : (member Name : string) (x))
let inline age (x : ^T) = (^T : (member Age : int) (x))
let inline nameAndAge x = (name x, age x)
type Person(name : string, age : int) =
member __.Name = name
member __.Age = age
type Employee(name : string, age : int, employeeId : string) =
member __.Name = name