Skip to content

Instantly share code, notes, and snippets.

View rue's full-sized avatar

Rue Saynatkari rue

View GitHub Profile
#ifndef RBX_GC_ROOT_HPP
#define RBX_GC_ROOT_HPP
#include <stdexcept>
#include "vm/linkedlist.hpp"
#include "vm/object.hpp"
#include "vm/oop.hpp"
#include "vm/prelude.hpp"
From a95d5bcc0ecc2263710d8769627813ac8e70dab4 Mon Sep 17 00:00:00 2001
From: Eero Saynatkari <esaynatkari@engineyard.com>
Date: Sat, 18 Oct 2008 03:10:45 +0300
Subject: [PATCH] Simplified NativeLibrary logic slightly.
---
vm/native_libraries.cpp | 43 ++++++++++++++++++-------------------------
vm/native_libraries.hpp | 47 ++++++++++++++++++-----------------------------
2 files changed, 36 insertions(+), 54 deletions(-)
# digest_fail.rb
require "digest/md5"
require "spec/frozen/1.8/library/digest/md5/shared/constants.rb"
d = Digest::MD5.new
p :original, MD5Constants::Contents
p :should_be, "a733b77177bef4e3e5d0c4e8cbcc8f6e"
module Foo
module Class
end
def self.foo
p constants
end
end
Foo.foo
ruerue@eero-desktop:~/code/rubinius/master$ gdb vm/test/runner
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) handle SIGUSR1 pass noprint nostop
Signal Stop Print Pass to program Description
rubinius 0.9.0 (ruby 1.8.6 compatible) (9889e9394) (08/04/2008) [i686-apple-darwin9.5.0]
Process.abort
- terminates execution immediately
Process::Constants
- should have the correct constant values on BSD-like systems (FAILED - 1)
- should have the correct constant values on Darwin (FAILED - 2)
Process#detach
23:33:47 ruerue@meow > vm/vm -rreadline -e 'p Readline.readline("> ")'
> Hi
"Hi"
23:33:59 ruerue@meow >
diff --git a/kernel/common/native_method.rb b/kernel/common/native_method.rb
index dfdc249..848a3cf 100644
--- a/kernel/common/native_method.rb
+++ b/kernel/common/native_method.rb
@@ -30,7 +30,6 @@ class NativeMethod < Executable
#
def self.load_entry_point(library_path, name)
Ruby.primitive :nativemethod_load_extension_entry_point
- raise PrimitiveFailure, "Unable to load #{name} in #{library_path}!"
end
@rue
rue / gist:11508
Created September 18, 2008 23:26
=> #<OpenStruct lines=[[0, -1, 57], [0, 17, 522], [18, 35, 523], [36, 53, 524], [54, 71, 525], [72, 89, 526], [90, 113, 528], [114, 128, 529], [129, 147, 531],
[148, 172, 534], [173, 193, 536], [194, 214, 537], [215, 245, 539], [246, 280, 541], [281, 307, 542], [308, 334, 543], [335, 361, 545], [362, 383, 546], [384,
420, 548], [421, 460, 550], [461, 519, 552], [520, 550, 554], [551, 578, 556], [579, 605, 559], [606, 622, 560], [623, 649, 562], [650, 656, 563], [657, 683,
564], [684, 717, 565], [718, 733, 566], [734, 749, 577], [750, 776, 578], [777, 793, 580], [794, 806, 583], [807, 825, 584], [826, 838, 587], [839, 862, 588]],
required_args=3, local_names=[:func, :term, :paren, :awords, :escape, :expand, :regexp, :symbol, :paren_re, :term_re, :c], __ivars__=nil, total_args=3,
name=:tokadd_string, primitive=nil, file=:"lib/compiler/ruby_lexer.rb", splat=nil, iseq=[18, 0, 23, 0, 36, 1, 1, 71, 76, 10, 14, 2, 8, 15, 3, 17, 3, 16, 18, 0,
23, 2, 36, 3, 1, 71, 76, 10, 32, 2, 8, 33, 3, 17, 4, 16, 18, 0,
@rue
rue / gist:11263
Created September 17, 2008 17:47
#ifndef RBX_BUILTIN_NATIVEMETHOD_HPP
#define RBX_BUILTIN_NATIVEMETHOD_HPP
/* Project */
#include "builtin/class.hpp"
#include "builtin/executable.hpp"
#include "builtin/task.hpp"
#include "vm.hpp"