Skip to content

Instantly share code, notes, and snippets.

View timfel's full-sized avatar

Tim Felgentreff timfel

View GitHub Profile
// class version 51.0 (51)
// access flags 0x21
public class example extends org/jruby/ast/executable/AbstractScript {
// compiled from: example.rb
// debug info: /home/tim/example.rb
// access flags 0x100A
private static setPosition(Lorg/jruby/runtime/ThreadContext;I)V
ALOAD 0

MagLev implementation of Ruby C extensions API.

This document explains the state of C extensions on Maglev. This is meant to become an exhaustive listing of the restrictions in the C API layer, their reasons, and how to work around them.

We also provide code examples for some workarounds at the end of this document.

If more restrictions are found, or you have code examples, please feel

Rubinius (only vm (C++) and kernel (Ruby)):
✈ ✔ sloccount rubinius/kernel rubinius/vm rubinius/lib/rubinius rubinius/lib/compiler rubinius/lib/vm/*
*snip*
Totals grouped by language (dominant language first):
cpp: 171909 (76.57%)
ruby: 36854 (16.42%)
ansic: 7702 (3.43%)
perl: 7400 (3.30%)
python: 518 (0.23%)
sh: 120 (0.05%)
127 Hours Gran Torino Pelham 123
14 Blades Green Hornet Percy Jackson
22 Bullets Green Zone PI
5 Days of War Gullivers Reisen Piranha
A Better Tomorrow Hanna Planet 51 (2009)
Adele und das Geheimnis des Pharaos Harry Potter 6 Rango
After Life Harry Potter und die Heiligtuemer des Todes Teil 1 R.E.D
Alles Erlaubt Hollywood Reality Red Riding Hood
Assault Girls Hunt to Kill Repo Men
Besouro I am number four Rio
~ maglev ✔ maglev-irb -f
irb(main):001:0> b = proc { p 1 }
=> #<Proc>
irb(main):002:0> b.instance_variable_get("@_st_block")
=> #<ExecBlock:0x561a6201
irb(main):003:0> block = b.instance_variable_get("@_st_block")
=> #<ExecBlock:0x561a6201
irb(main):004:0> block.class
=> ExecBlock
irb(main):005:0> block.class.primitive '_sourceString', '_sourceString'
require File.expand_path("../calculator.rb", __FILE__)
services = %w[172.16.59.95
172.16.59.124
172.16.59.243
172.16.57.39
172.16.58.233
172.16.57.12
172.16.56.214
172.16.59.172
echo "You have 10 seconds, then I'll start and take $[$1 + 1] screenshots and press space $1 times"
sleep 10
/usr/bin/import -window root "screen_0.jpg"
for i in `seq -w 1 $1`; do
xdotool key space
sleep 3
/usr/bin/import -window root "screen_${i}.jpg"
done
convert "screen_*.jpg" presentation_to_pdf.pdf
rm screen_*.jpg
export PATH=/usr/bin:/bin
RPApplication subclass: #TestApp
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'TestApp'.
echoSomething
<get: '/'>
self error: 'Shows error info about me'.