This file contains 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
# extract dead objects from the heap | |
require 'json' | |
require 'set' | |
class Slot | |
attr_reader :info, :address_to_slot | |
def initialize info, address_to_slot | |
@info = info |
This file contains 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 'ds9' | |
require 'socket' | |
require 'uri' | |
require 'google/protobuf' | |
require 'io/wait' | |
require 'helloworld_pb' | |
class MySession < DS9::Client | |
def initialize sock | |
@sock = sock |
This file contains 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 'uart' | |
require 'io/wait' | |
class Sample < Struct.new(:time, | |
:pm1_0_standard, :pm2_5_standard, :pm10_standard, | |
:pm1_0_env, :pm2_5_env, | |
:concentration_unit, | |
:particle_03um, :particle_05um, :particle_10um, | |
:particle_25um, :particle_50um, :particle_100um) | |
end |
This file contains 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
#!/Users/aaron/.rbenv/versions/ruby-trunk/bin/ruby | |
require 'benchmark/ips' | |
require './lib/track_obj' | |
if ARGV[0] == "--trace" | |
tp = TrackObj.make_tp | |
tp.enable | |
end |
This file contains 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
cons = lambda { |a, b| | |
lambda { |m| m.call(a, b) } | |
} | |
car = lambda { |m| m.call(lambda { |a, _| a }) } | |
cdr = lambda { |m| m.call(lambda { |_, b| b }) } | |
# A list that only uses lambdas | |
list = cons.call(1, cons.call(2, cons.call(3, nil))) |
This file contains 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
def foo ; | |
puts ; | |
end | |
foo "hello" |
This file contains 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
def foo | |
puts | |
end | |
foo "hello" |
This file contains 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/compile.c b/compile.c | |
index 5415d684a6..5d37c730ef 100644 | |
--- a/compile.c | |
+++ b/compile.c | |
@@ -1596,6 +1596,9 @@ iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, | |
for (i = 0; i < RARRAY_LEN(default_values); i++) { | |
VALUE dv = RARRAY_AREF(default_values, i); | |
if (dv == complex_mark) dv = Qundef; | |
+ if (!SPECIAL_CONST_P(dv)) { | |
+ RB_OBJ_WRITTEN(iseq, Qundef, dv); |
This file contains 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/compile.c b/compile.c | |
index 5415d684a6..666c679328 100644 | |
--- a/compile.c | |
+++ b/compile.c | |
@@ -1596,6 +1596,9 @@ iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, | |
for (i = 0; i < RARRAY_LEN(default_values); i++) { | |
VALUE dv = RARRAY_AREF(default_values, i); | |
if (dv == complex_mark) dv = Qundef; | |
+ if (!SPECIAL_CONST_P(dv)) { | |
+ RB_OBJ_WRITTEN(iseq, Qundef, dv); |
This file contains 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
|