Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f10b62fbe349
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fe572229a597
Choose a head ref

Commits on May 12, 2015

  1. Fixed Array#concat.

    Amortizing the allocation costs over the number of elements
    requires doubling the capacity rather than using the exact
    size needed.
    brixen committed May 12, 2015
    Copy the full SHA
    053e1e9 View commit details

Commits on May 13, 2015

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf0a6b9 View commit details
  2. Copy the full SHA
    47b0b6c View commit details
  3. Copy the full SHA
    41cebe1 View commit details
  4. Added rb_vsprintf.

    brixen committed May 13, 2015
    Copy the full SHA
    1f9a63a View commit details
  5. Added rb_absint_size.

    brixen committed May 13, 2015
    Copy the full SHA
    c539381 View commit details
  6. Copy the full SHA
    de3b0e9 View commit details
  7. Update bundler to 1.9.7.

    brixen committed May 13, 2015
    Copy the full SHA
    81e5794 View commit details
  8. Copy the full SHA
    a4673b9 View commit details
  9. Added rb_struct_s_members()

    This function simply returns the members of a Struct, although it
    segfaults on MRI when given an instance of the return value of
    Struct.new(...).
    Yorick Peterse committed May 13, 2015
    Copy the full SHA
    2642a30 View commit details

Commits on May 14, 2015

  1. Copy the full SHA
    7a13ef4 View commit details
  2. Fixed Array::concat, again.

    brixen committed May 14, 2015
    Copy the full SHA
    8854567 View commit details

Commits on May 15, 2015

  1. Fixed -Xjit.profile. Closes #3212.

    brixen committed May 15, 2015
    Copy the full SHA
    e8e4cf8 View commit details
  2. Copy the full SHA
    cf7e30d View commit details
  3. Updated rubinius-profiler.

    brixen committed May 15, 2015
    Copy the full SHA
    147fa57 View commit details
  4. Copy the full SHA
    a91c53b View commit details
  5. Added Thread#pid. Closes #3365.

    Unfortunately, this works great on Linux and not-so-great on OS X. I was
    unable to find any syscall that would provide the same behavior as Linux.
    
    We also may end up needing more #ifdefs.
    brixen committed May 15, 2015
    Copy the full SHA
    cda7249 View commit details
  6. Added RbConfig::CONFIG['THREAD_MODEL']

    This is used by rubysl-openssl to set the threading model.
    Yorick Peterse committed May 15, 2015
    Copy the full SHA
    8646ad5 View commit details
  7. Use rubysl-digest 2.0.7

    Yorick Peterse committed May 15, 2015
    Copy the full SHA
    45eeaa0 View commit details
  8. Updated bundler to 1.9.8.

    brixen committed May 15, 2015
    Copy the full SHA
    433d9b8 View commit details

Commits on May 16, 2015

  1. Cleaned up ThreadGroup.

    brixen committed May 16, 2015
    3
    Copy the full SHA
    00c04b9 View commit details
  2. Copy the full SHA
    3adb355 View commit details
  3. Wraps CONTRIBUTING at 80 columns

    I predict this will save horizontal scrolling by at least 36%. *Note*:
    93% of all statistics are entirely made-up on the spot.
    benlovell committed May 16, 2015
    Copy the full SHA
    2fe320b View commit details
  4. Quotes inline code/shell elements

    I noticed there was a few code/shell elements that may benefit from
    being backticked. It should help one scan this guide and pick out some
    of the most useful reference points.
    benlovell committed May 16, 2015
    Copy the full SHA
    731fe0d View commit details
  5. Merge pull request #3402 from benlovell/master

    Minor documentation fixes
    Yorick Peterse committed May 16, 2015
    Copy the full SHA
    30d3c25 View commit details

Commits on May 17, 2015

  1. Merge remote-tracking branch 'origin' into 1.8.7

    Conflicts:
    	gems_list.txt
    	kernel/bootstrap/thread.rb
    	library/rbconfig.rb
    	spec/ruby/core/process/detach_spec.rb
    	spec/ruby/optional/capi/string_spec.rb
    	vm/builtin/array.cpp
    	vm/include/capi/ruby/ruby.h
    brixen committed May 17, 2015
    Copy the full SHA
    6a35445 View commit details
  2. Match only v1.x tags.

    brixen committed May 17, 2015
    Copy the full SHA
    fe57222 View commit details
91 changes: 65 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,102 @@
## Contributing To Rubinius

We want to start off by saying thank you for using Rubinius. This project is a labor of love, and we appreciate all of the users that catch bugs, make performance improvements, and help with documentation. Every contribution is meaningful, so thank you for participating. That being said, here are a few guidelines that we ask you to follow so we can successfully address your issue.
We want to start off by saying thank you for using Rubinius. This project is a
labor of love, and we appreciate all of the users that catch bugs, make
performance improvements, and help with documentation. Every contribution is
meaningful, so thank you for participating. That being said, here are a few
guidelines that we ask you to follow so we can successfully address your issue.

### Submitting Issues

Please include the following:

* The Rubinius version (rbx -v)
* Your OS (uname -a) RVM/rbenv/chruby/etc version or the commit hash from git if you're building off of a clone
* Stack trace (preferably as a Gist, since they're easier to read) If you can add a failing spec, that's great!
* Please include the simplest possible reproduction you can. This last point is vital to fixing issues.
* The Rubinius version (`rbx -v`)
* Your OS (`uname -a`) RVM/rbenv/chruby/etc version or the commit hash from git
if you're building off of a clone
* Stack trace (preferably as a Gist, since they're easier to read.) If you can
add a failing spec, that's great!
* Please include the simplest possible reproduction you can. This last point is
vital to fixing issues.

If available, please also include the contents of the following files as a Gist:
If available, please also include the contents of the following files as a
Gist:

* configure.log
* config.rb
* `configure.log`
* `config.rb`

These two files contain the output of the compilation process and the various configuration options used (e.g. compiler options).
These two files contain the output of the compilation process and the various
configuration options used (e.g. compiler options).

### Running Specs

MSpec provides several different scripts to run the specs under different conditions. The default behavior is to simply run all the specs. If you invoke the following command, it will run all the Ruby Array specs:
MSpec provides several different scripts to run the specs under different
conditions. The default behavior is to simply run all the specs. If you invoke
the following command, it will run all the Ruby Array specs:

$ bin/mspec core/array

The -t option specifies which Ruby implementation to run the specs under. The default in Rubinius is to run them with Rubinius, so -tx is implied. You can easily run with another target by giving the name of an executable on your PATH or the full path to an executable. Since the specs are intended to show the behavior of MRI, if you are writing new specs you need to run them under the current stable release of MRI 2.0. For example, if you have a ruby2.0.0 executable on your PATH, you can do the following:
The `-t` option specifies which Ruby implementation to run the specs under. The
default in Rubinius is to run them with Rubinius, so `-tx` is implied. You can
easily run with another target by giving the name of an executable on your PATH
or the full path to an executable. Since the specs are intended to show the
behavior of MRI, if you are writing new specs you need to run them under the
current stable release of MRI 2.0. For example, if you have a `ruby2.0.0`
executable on your `PATH`, you can do the following:

$ bin/mspec -t ruby2.0.0 core/array

Finally, if you are running bin/mspec in the Rubinius source directory, the location of the RubySpecs are known (spec/ruby/), so you can use the full path or the shortened version core/array above.
Finally, if you are running `bin/mspec` in the Rubinius source directory, the
location of the RubySpecs are known (`spec/ruby/`), so you can use the full path
or the shortened version `core/array` above.

### Fixing A Bug

* Fork the repo, create a topic branch, and include a spec, if appropriate. Pull requests that need a spec but are submitted without one will be delayed until one is written. The spec should be in a separate commit.
* Please follow the [Coding Style Guide](http://rubini.us/doc/en/contributing/style-guide)
* **Always run the full spec suite**. `rake` will run the VM specs plus RubySpec.
* Please add a detailed commit message. Here is a [fantastic example](https://github.com/rubinius/rubinius/commit/1f9ddd1) by @ryoqun . The preference is for a (max) 50 character summary as line one, a blank line, then any number of lines, no longer than 80 characters.
* Fork the repo, create a topic branch, and include a spec, if appropriate.
Pull requests that need a spec but are submitted without one will be delayed
until one is written. The spec should be in a separate commit.
* Please follow the [Coding Style
Guide](http://rubini.us/doc/en/contributing/style-guide)
* **Always run the full spec suite**. `rake` will run the VM specs plus
RubySpec.
* Please add a detailed commit message. Here is a [fantastic
example](https://github.com/rubinius/rubinius/commit/1f9ddd1) by @ryoqun .
The preference is for a (max) 50 character summary as line one, a blank line,
then any number of lines, no longer than 80 characters.
* Send in that pull request!
* Follow up with us on the ticket if we haven't merged or commented in a few days. We strive to address issues in a reasonable time. If we miss yours, please remind us.
* When unsure about the changes, associated specs or other topics, please ask! We're more than eager to help.
* Follow up with us on the ticket if we haven't merged or commented in a few
days. We strive to address issues in a reasonable time. If we miss yours,
please remind us.
* When unsure about the changes, associated specs or other topics, please ask!
We're more than eager to help.

### Writing Specs

A lot of this is already covered in [How To Write A Spec](http://rubini.us/doc/en/how-to/write-a-spec/) but the basic gist of it is as following:
A lot of this is already covered in [How To Write A
Spec](http://rubini.us/doc/en/how-to/write-a-spec/) but the basic gist of it is
as following:

* Spec descriptions (for both "describe" and "it" blocks) should be written in natural English.
* Specs should include only the bare minimum that is required to test something.
* Setup code that is re-used between examples should be placed in a before() block
* Spec descriptions (for both `describe` and `it` blocks) should be written in
natural English.
* Specs should include only the bare minimum that is required to test
something.
* Setup code that is re-used between examples should be placed in a `before()`
block
* When unsure, please ask!

### Performance Patches

We love these!

* Include benchmarks before and after the change. Please include your hardware specs, namely CPU speed, # of cores, speed of hard drive (if SSD, then SSD is fine) and amount of RAM.
* **Always run the full spec suite**. `rake` will ensure you didn't accidentally break anything.
* Include benchmarks before and after the change. Please include your hardware
specs, namely CPU speed, # of cores, speed of hard drive (if SSD, then SSD is
fine) and amount of RAM.
* **Always run the full spec suite**. `rake` will ensure you didn't
accidentally break anything.

For more details on how to contribute, please see [Contributing to Rubinius](http://rubini.us/2011/10/18/contributing-to-rubinius/).
For more details on how to contribute, please see [Contributing to
Rubinius](http://rubini.us/2011/10/18/contributing-to-rubinius/).

For more help, visit the [Rubinius Gitter chat room](https://gitter.im/rubinius/rubinius)
For more help, visit the [Rubinius Gitter chat
room](https://gitter.im/rubinius/rubinius)

Again, thank you!
1 change: 1 addition & 0 deletions kernel/bootstrap/load_order.txt
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ stat.rbc
string.rbc
symbol.rbc
thread.rbc
thread_mirror.rbc
thunk.rbc
time.rbc
true.rbc
8 changes: 3 additions & 5 deletions kernel/bootstrap/thread.rb
Original file line number Diff line number Diff line change
@@ -93,7 +93,6 @@ def __run__
Rubinius.check_interrupts
ensure
unlock_locks
@joins.each { |join| join.send self }
end
end
rescue Exception => e
@@ -107,6 +106,9 @@ def __run__
STDERR.puts "Exception in thread: #{@exception.message} (#{@exception.class})"
end
end

Rubinius::Mirror.reflect(@group).remove self

@alive = false
Rubinius.unlock(self)
end
@@ -314,10 +316,6 @@ def group
@group
end

def add_to_group(group)
@group = group
end

def raise(exc=undefined, msg=nil, trace=nil)
Rubinius.lock(self)

9 changes: 9 additions & 0 deletions kernel/bootstrap/thread_mirror.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Rubinius
class Mirror
class Thread < Mirror
def group=(group)
Rubinius.invoke_primitive :object_set_ivar, @object, :@group, group
end
end
end
end
1 change: 1 addition & 0 deletions kernel/common/load_order.txt
Original file line number Diff line number Diff line change
@@ -74,6 +74,7 @@ sprinter.rbc
symbol.rbc
thread.rbc
thread_group.rbc
thread_group_mirror.rbc
throw_catch.rbc
time.rbc
true.rbc
1 change: 1 addition & 0 deletions kernel/common/thread.rb
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
class Thread

attr_reader :recursive_objects
attr_reader :pid

# Implementation note: ideally, the recursive_objects
# lookup table would be different per method call.
31 changes: 10 additions & 21 deletions kernel/common/thread_group.rb
Original file line number Diff line number Diff line change
@@ -7,34 +7,23 @@ def initialize
Default = ThreadGroup.new

def add(thread)
if thread.group
thread.group.remove(thread)
end
thread.add_to_group self
if g = thread.group
raise ThreadError, "can't move from the enclosed thread group" if g.enclosed?

@threads.delete_if do |w|
obj = w.__object__
!(obj and obj.alive?)
gm = Rubinius::Mirror.reflect g
gm.remove thread
end

@threads << WeakRef.new(thread)
self
end
tm = Rubinius::Mirror.reflect thread
tm.group = self

def remove(thread)
if enclosed?
raise ThreadError, "can't move from the enclosed thread group"
end
@threads.delete_if { |w| w.__object__ == thread }
@threads << thread

self
end

def list
list = []
@threads.each do |w|
obj = w.__object__
list << obj if obj and obj.alive?
end
list
@threads
end

def enclose
13 changes: 13 additions & 0 deletions kernel/common/thread_group_mirror.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Rubinius
class Mirror
class ThreadGroup < Mirror
self.subject = ::ThreadGroup

def remove(thread)
ary = Rubinius.invoke_primitive :object_get_ivar, @object, :@threads
ary.delete thread
end

end
end
end
2 changes: 1 addition & 1 deletion rakelib/release.rb
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ def revision_file
end

def describe_revision
@description ||= `git describe --tags --abbrev=40 --long`
@description ||= `git describe --tags --match=v1* --abbrev=40 --long`
end

def release_revision
13 changes: 13 additions & 0 deletions spec/ruby/core/array/concat_spec.rb
Original file line number Diff line number Diff line change
@@ -110,4 +110,17 @@
ary[3].untrusted?.should be_false
end
end

it "appends elements to an Array with enough capacity that has been shifted" do
ary = 1, 2, 3, 4, 5
2.times { ary.shift }
2.times { ary.pop }
ary.concat([5, 6]).should == [3, 5, 6]
end

it "appends elements to an Array without enough capacity that has been shifted" do
ary = 1, 2, 3, 4
3.times { ary.shift }
ary.concat([5, 6]).should == [4, 5, 6]
end
end
26 changes: 3 additions & 23 deletions spec/ruby/core/process/detach_spec.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
require File.expand_path('../../../spec_helper', __FILE__)
require 'timeout'

describe "Process.detach" do
platform_is_not :windows do
it "returns a thread" do
pid = Process.fork { Process.exit! }
thr = Process.detach(pid)
thr.should be_kind_of(Thread)
timeout(3) { thr.join }
thr.join
end

it "produces the exit Process::Status as the thread value" do
pid = Process.fork { Process.exit! }
thr = Process.detach(pid)
timeout(3) { thr.join }
thr.join

status = thr.value
status.should be_kind_of(Process::Status)
@@ -23,28 +22,9 @@
platform_is_not :openbsd do
it "reaps the child process's status automatically" do
pid = Process.fork { Process.exit! }
thr = Process.detach(pid)
timeout(3) { thr.join }
Process.detach(pid).join
lambda { Process.waitpid(pid) }.should raise_error(Errno::ECHILD)
end
end

ruby_version_is "1.9" do
it "sets the :pid thread-local to the PID" do
pid = Process.fork { Process.exit! }
thr = Process.detach(pid)
timeout(3) { thr.join }

thr[:pid].should == pid
end

it "provides a #pid method on the returned thread which returns the PID" do
pid = Process.fork { Process.exit! }
thr = Process.detach(pid)
timeout(3) { thr.join }

thr.pid.should == pid
end
end
end
end
4 changes: 4 additions & 0 deletions spec/ruby/optional/capi/ext/rubyspec.h
Original file line number Diff line number Diff line change
@@ -497,6 +497,8 @@
#define HAVE_RB_SECURE 1

/* String */
#define HAVE_RB_ALLOC_TMP_BUFFER 1
#define HAVE_RB_FREE_TMP_BUFFER 1
#define HAVE_RB_CSTR2INUM 1
#define HAVE_RB_CSTR_TO_INUM 1
#define HAVE_RB_STR2CSTR 1
@@ -547,6 +549,7 @@
#define HAVE_RB_STR_LENGTH 1
#define HAVE_RB_STR_EQUAL 1
#define HAVE_RB_STR_SUBSEQ 1
#define HAVE_RB_VSPRINTF 1
#endif

/* Struct */
@@ -555,6 +558,7 @@
#define HAVE_RB_STRUCT_DEFINE 1
#define HAVE_RB_STRUCT_NEW 1
#define HAVE_RB_STRUCT_GETMEMBER 1
#define HAVE_RB_STRUCT_S_MEMBERS 1

/* Symbol */
#define HAVE_RB_ID2NAME 1
Loading