Skip to content

Instantly share code, notes, and snippets.

View rednaxelafx's full-sized avatar

Kris Mok rednaxelafx

View GitHub Profile
@mastbaum
mastbaum / ftrapv.cpp
Created June 2, 2011 16:38
A demonstration of GCC's ftrapv flag for C++ integer overflow debugging
#include<iostream>
#include<signal.h>
#include<limits.h>
/** g++'s -ftrapv flag provides some protection against integer overflows. It
* is a little awkward to use, though. All it will do is "trap" -- you must
* provide a signal handler to deal with it.
*
* (You must compile with -ftrapv for this to work)
*/
anonymous
anonymous / gist:878653
Created March 20, 2011 20:37
import java.util.Collections
import java.util.ArrayList
list = ArrayList.new [ "one", "two", "three", "four" ]
puts "unsorted: #{list}"
Collections.sort(list) do |s1, s2|
l1 = dynamic(s1).length
l2 = dynamic(s2).length
@authorNari
authorNari / gist:875822
Created March 18, 2011 09:36
CRuby's Parallel Marking (Draft)
CRuby's Parallel Marking (Draft)(Ja)
ソースコード: https://github.com/authorNari/ruby
※まだ実装中
1 Abstract
並列スレッドの仕事分配には「Arora's Task Stealing Deque」のアルゴリズムを利用する。
http://doi.acm.org/10.1145/277651.277678
また、並列マークの実装の大部分はOpenJDK7のコードを参考に独自改良したものである。

Building MLVM version of OpenJDK (Java 1.8) on Mac OS X

Take a look at the comments and code in update.sh.

Requires a working version of Java 1.8.

I use create_tarball.sh to make a copy of the build to share.

OpenJDK 1.7 builds for Mac OS X: