Skip to content

Instantly share code, notes, and snippets.

require "irb"
Encoding.default_internal = "cp932"
Encoding.default_external = "cp932"
path = "/home/nari/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/irb/lc/ja/error.rb"
src = IRB::MagicFile.open(path){|f| f.read}
p src.encoding
eval(src)
@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のコードを参考に独自改良したものである。
@authorNari
authorNari / bokuno_twitter.rb
Created March 27, 2011 02:57
my twitter!!!
# -*- coding: utf-8 -*-
$screen_names_of_me ||= []
$screen_names_of_timeline ||= []
$words_of_timeline ||= []
$tweet_counts ||= {}
$tweet_limit_of_day = 2
Earthquake.init do
output do |item|
next unless item["event"]
@authorNari
authorNari / gist:901085
Created April 4, 2011 03:04
OpenJDKのクラス階層
ADLParser
ALLOCATION_SUPER_CLASS_SPEC
AbsSeq
NumberSeq
TruncatedSeq
AbstractGangTask
CMConcurrentMarkingTask
CMRemarkTask
CMSParRemarkTask
CMSRefEnqueueTaskProxy
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct data {
int flag;
struct data *next;
} data_t;
static data_t *top = NULL;
@authorNari
authorNari / deque_vs_recusion.c
Created May 13, 2011 00:40
Aora's deque vs recusion.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#define FALSE 0
#define TRUE 1
typedef uint32_t half_word;
union deque_age {
@authorNari
authorNari / gist:976348
Created May 17, 2011 11:59
Local stack of Aora's dequeue vs recusion.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#define FALSE 0
#define TRUE 1
typedef uint32_t half_word;
union deque_age {
diff --git a/gc.c b/gc.c
index d5b8dfd..08c0aea 100644
--- a/gc.c
+++ b/gc.c
@@ -1277,7 +1277,8 @@ ruby_get_stack_grow_direction(volatile VALUE *addr)
}
#endif
-#define GC_WATER_MARK 512
+#define GC_LEVEL_MAX 250
@authorNari
authorNari / gist:1273388
Created October 9, 2011 06:58
rubyconf2011 pronunciation
= done
- introduce
[in]tro(du)ce
- atomically
a..(to)mically
- substantially
subs(tan)tially
- decreases
[de] c(rea)ses
- algorithm あるごうぃーずむ
@authorNari
authorNari / gist:1274991
Created October 10, 2011 10:10
rubyconf ar bio
Narihiro Nakamura is a research worker at Network Applied Communication Laboratory Ltd..
He is a CRuby committer. And he is a Garbage Collection lover. So, he works on GC in CRuby.
Lazy Sweep GC is one of his works for CRuby's GC. You can use it since Ruby 1.9.3!