This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sequel' | |
require 'mysqlplus' | |
class Mysql | |
unless method_defined? :sync_query | |
alias :sync_query :query | |
alias :query :async_query | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- eval.c.orig 2008-08-03 20:24:26.000000000 -0700 | |
+++ eval.c 2008-09-02 14:03:15.000000000 -0700 | |
@@ -10761,6 +10761,8 @@ | |
#endif | |
} | |
+static int thread_init; | |
+ | |
static void | |
rb_thread_restore_context(th, exit) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'eventmachine' | |
class EventMachine::Timer | |
def reset seconds | |
prev = EM.instance_variable_get('@timers')[@signature] | |
cancel | |
initialize(seconds){ prev.call } | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'eventmachine' | |
GC.disable | |
def Object.finalizer info = nil | |
proc{ | |
p [Time.now, :FINALIZER, info] | |
} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'eventmachine' | |
GC.disable | |
class Test | |
Instances = {} | |
def initialize name | |
@name = name | |
Instances[name] = self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/gc.c b/gc.c | |
index 45facf0..a246ce9 100644 | |
--- a/gc.c | |
+++ b/gc.c | |
@@ -74,7 +74,12 @@ static unsigned long malloc_increase = 0; | |
static unsigned long malloc_limit = GC_MALLOC_LIMIT; | |
static void run_final(); | |
static VALUE nomem_error; | |
+#ifdef DEBUG_REACHABILITY | |
+static VALUE garbage_collect0 _((VALUE)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'eventmachine' | |
Port = (ARGV[0] && ARGV[0].to_i) || 4567 | |
Host = ARGV[1] || '10.0.2.4' | |
p ['starting proxy', Host, Port] | |
EM.run{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def space_case | |
gsub(/([a-z]|[A-Z]+)([A-Z])/){ "#{$1} #{$2}" } | |
end | |
def snake_case | |
gsub(/\B[A-Z][^A-Z]/, '_\&').downcase.gsub(' ', '_') | |
end | |
end | |
class Graph |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'eventmachine' | |
module TapsClient | |
def connection_completed | |
p [Time.now, :connected] | |
send_data("hey!") | |
end | |
def receive_data(data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/eval.c b/eval.c | |
index a238472..2a3baea 100644 | |
--- a/eval.c | |
+++ b/eval.c | |
@@ -13617,6 +13604,19 @@ rb_fiber_current() | |
return th->fiber; | |
} | |
+static VALUE | |
+make_passing_arg(int argc, VALUE *argv) |