Skip to content

Instantly share code, notes, and snippets.

View tenderlove's full-sized avatar
©️
 ​[object Object] :trollface:

Aaron Patterson tenderlove

©️
 ​[object Object] :trollface:
View GitHub Profile
def foo  
puts  
end
foo "hello"
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);
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);
amazing >​<
require 'psych'
class RepresentWithSeq
Psych.add_tag name, self
attr_accessor :seq
def initialize
@seq = %w{ foo bar }
end
def ​ ‌
‌ + " world"
end
p ​ "hello"
defmodule ProcCons do
def cons(x, y) do
loop = fn the_loop ->
receive do
{ sender } -> send(sender, { x, y })
end
the_loop.(the_loop)
end
spawn fn -> loop.(loop) end
end
From f01f8991d2cd4610c0f4284bf7409e999e47b840 Mon Sep 17 00:00:00 2001
From: Sokolov Yura aka funny_falcon <[email protected]>
Date: Mon, 12 Dec 2016 14:23:17 +0300
Subject: [PATCH] load.c: reduce memory usage of loaded_features_index
Use integer hashsum instead of string as a key in loaded_features_index.
Do not use ruby strings for substring operation, just plain pointer
and length.
---
load.c | 41 ++++++++++++++++++++---------------------
This file has been truncated, but you can view the full file.
malloc_history Report Version: 2.0
Process: ruby [15986]
Path: /Users/aaron/.rbenv/versions/ruby-trunk/bin/ruby
Load Address: 0x10435d000
Identifier: ruby
Version: 0
Code Type: X86-64
Parent Process: bash [451]
Date/Time: 2018-02-09 12:55:49.658 -0800