Skip to content

Instantly share code, notes, and snippets.

View k-tsj's full-sized avatar

Kazuki Tsujimoto k-tsj

View GitHub Profile
@k-tsj
k-tsj / .gdbinit
Created April 22, 2012 10:59
.gdbinit for mruby
define dump_irep
set $i = 0
set $irep = ($arg0)
while ($i < $irep->ilen)
set $code = $irep->iseq[$i]
set $OPCODE = ((mrb_code)($code) & 0x7f)
set $ARG_A = ((((mrb_code)($code)) >> 23) & 0x1ff)
set $ARG_B = ((((mrb_code)($code)) >> 14) & 0x1ff)
set $ARG_C = ((((mrb_code)($code)) >> 7) & 0x7f)
set $ARG_Bx = ((((mrb_code)($code)) >> 7) & 0xffff)
@k-tsj
k-tsj / test-all.log
Created February 5, 2012 14:12
r34308 test-all --gc-stress log
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems "./test/runner.rb" --ruby="./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" -vq -j4 --jobs-status -x etc/test_etc.rb -x benchmark -x webrick -x xmlrpc/test_cookie.rb -x cgi/test_cgi_tag_helper.rb -x drb --gc-stress
Run options: "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" -vq -j4 --jobs-status -x etc/test_etc.rb -x benchmark -x webrick -x xmlrpc/test_cookie.rb -x cgi/test_cgi_tag_helper.rb -x drb --gc-stress
# Running tests:
1465:waiting 1467:waiting 1470=test_rake_task_lib 1472:waiting
1465:waiting 1467:waiting 1470=test_rake_task_lib 1472=test_rake_pseudo_status
1465=test_rake_win32 1467:waiting 1470=test_rake_task_lib 1472=test_rake_pseudo_status
1465=test_rake_win32 1467:waiting 1470=test_rake_task_lib 1472=test_rake_pseudo_status
1465=test_rake_win32 1467:waiting 1470=test_rake_task_lib 1472=test_rake_pseudo_status
@k-tsj
k-tsj / app_pentomino.log
Created February 4, 2012 16:12
bm_app_pentomino log
$ make benchmark OPTS='-r 2 -o '${rev}'.log --executables="./ruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext --" --pattern="bm_app_pent"'
b418bc9be47ac63da559cb4bbdf705d83d99cde2.log:ruby 2.0.0dev (2011-11-25) [x86_64-linux] 18.3015801906586
b418bc9be47ac63da559cb4bbdf705d83d99cde2.log:ruby 2.0.0dev (2011-11-25) [x86_64-linux] 17.8015170097351
450c2094be9ef5ddf0f5f91f1744e03dac93af31.log:ruby 2.0.0dev (2011-11-25) [x86_64-linux] 17.7401349544525
450c2094be9ef5ddf0f5f91f1744e03dac93af31.log:ruby 2.0.0dev (2011-11-25) [x86_64-linux] 17.962229013443
746aa6f74b55b1783242b4f074200105dd7d90bc.log:ruby 2.0.0dev (2011-11-25) [x86_64-linux] 17.7444908618927
746aa6f74b55b1783242b4f074200105dd7d90bc.log:ruby 2.0.0dev (2011-11-25) [x86_64-linux] 18.1857919692993
1e79a33e2178202bbc7f08996bfd7cffe30f48f9.log:ruby 2.0.0dev (2011-11-25) [x86_64-linux] 17.8341698646545
1e79a33e2178202bbc7f08996bfd7cffe30f48f9.log:ruby 2.0.0dev (2011-11-25) [x86_64-linux] 17.9613330364227
@k-tsj
k-tsj / match.rb
Created February 4, 2012 02:52
Pattern match in ruby
# Copyright (C) 2012 Kazuki Tsujimoto, All rights reserved.
#
# You can redistribute it and/or modify it under the terms of the 2-clause BSDL.
class Pattern
attr_accessor :parent
attr_reader :env
def initialize(*children)
@parent = nil
@k-tsj
k-tsj / update-ruby-trunk-changes-notes.sh
Last active December 31, 2018 04:10
update-ruby-trunk-changes-notes.sh
#!/bin/sh
# Usage:
# update-ruby-trunk-changes-notes.sh YYYY-MM-DD
export LANG=en_US.UTF-8
REPOSDIR=/var/working/ruby-trunk-changes-notes
TMPDIR=/tmp/ruby-trunk-changes
URL_PREFIX='https://ruby-trunk-changes.hatenablog.com/archive/'
@k-tsj
k-tsj / config
Created December 11, 2011 09:06
git log with ruby-trunk-changes(http://d.hatena.ne.jp/nagachika/)
# 1. Add following lines to .git/config.
# 2. Run "git fetch k-tsj".
# 3. Run "git log".
[core]
notesRef = refs/notes/ruby-trunk-changes # or "git log --show-notes=ruby-trunk-changes"
[remote "k-tsj"]
fetch = +refs/notes/*:refs/notes/*
url = git://github.com/k-tsj/ruby.git
@k-tsj
k-tsj / gist:1275472
Created October 10, 2011 14:34
Patch for ruby-coreaudio
diff --git a/coreaudio.gemspec b/coreaudio.gemspec
index 06346b1..12aee3b 100644
--- a/coreaudio.gemspec
+++ b/coreaudio.gemspec
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
"ext/extconf.rb",
"lib/coreaudio.rb"
]
- s.homepage = "http://github.com/nagachika/coreaudio"
+ s.homepage = "https://github.com/nagachika/ruby-coreaudio"
@k-tsj
k-tsj / gist:1257387
Created October 2, 2011 11:58
Similar to Bug #5386
max = 1
max.times{
Fiber.new{}
}
max = 1000
@cnt = 0
(1..100).map{|ti|
Thread.new{
max.times{|i|
@k-tsj
k-tsj / gist:1192218
Created September 4, 2011 03:49
Renamed INSTALL.eucjp to INSTALL.utf-
From 834fd3b4936cf26f24f8f6392730a1763fd633b6 Mon Sep 17 00:00:00 2001
From: Kazuki Tsujimoto <[email protected]>
Date: Sun, 4 Sep 2011 12:40:56 +0900
Subject: [PATCH] Renamed INSTALL.eucjp to INSTALL.utf-8
---
ChangeLog | 4 ++++
Gauche.spec | 2 +-
Makefile.in | 4 ++--
3 files changed, 7 insertions(+), 3 deletions(-)
@k-tsj
k-tsj / 5234.patch
Created August 27, 2011 06:22
kludge fix for Bug #5234
diff --git a/proc.c b/proc.c
index 299a220..0a98207 100644
--- a/proc.c
+++ b/proc.c
@@ -418,6 +418,7 @@ proc_new(VALUE klass, int is_lambda)
}
procval = rb_vm_make_proc(th, block, klass);
+ rb_rewrite_dfp_in_errinfo(th, cfp);