Skip to content

Commit

Permalink
Merge branch 'copy_on_write' into zero_copy_context_switch
Browse files Browse the repository at this point in the history
Conflicts:
	eval.c
  • Loading branch information
FooBarWidget committed Jan 4, 2010
2 parents 13d650d + 3123f18 commit 60593a7
Show file tree
Hide file tree
Showing 67 changed files with 1,365 additions and 395 deletions.
468 changes: 468 additions & 0 deletions ChangeLog

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ with all sufficient information, see the ChangeLog file.

New alias to #inject.

* Enumerable#to_a

Can take optional arguments and pass them to #each.

* Hash#eql?
* Hash#hash
* Hash#==
Expand Down Expand Up @@ -263,12 +267,17 @@ with all sufficient information, see the ChangeLog file.

* Regexp.union accepts an array of patterns.

* String#bytes

New method

* String#bytesize

New method, returning the size in bytes. (alias length and size)

* String#chars
* String#each_char
* String#lines
* String#partition
* String#rpartition
* String#start_with?
Expand Down
12 changes: 6 additions & 6 deletions bignum.c
Original file line number Diff line number Diff line change
Expand Up @@ -2038,8 +2038,8 @@ rb_big_lshift(x, y)
y = rb_to_int(y);
}

if (neg) return big_rshift(x, shift);
return big_lshift(x, shift);
x = neg ? big_rshift(x, shift) : big_lshift(x, shift);
return bignorm(x);
}

static VALUE
Expand Down Expand Up @@ -2067,7 +2067,7 @@ big_lshift(x, shift)
num = BIGDN(num);
}
*zds = BIGLO(num);
return bignorm(z);
return z;
}

/*
Expand Down Expand Up @@ -2107,8 +2107,8 @@ rb_big_rshift(x, y)
y = rb_to_int(y);
}

if (neg) return big_lshift(x, shift);
return big_rshift(x, shift);
x = neg ? big_lshift(x, shift) : big_rshift(x, shift);
return bignorm(x);
}

static VALUE
Expand Down Expand Up @@ -2153,7 +2153,7 @@ big_rshift(x, shift)
if (!RBIGNUM(x)->sign) {
get2comp(z);
}
return bignorm(z);
return z;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion class.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ rb_singleton_class_clone(obj)
data.klass = obj;
break;
default:
data.klass = 0;
data.klass = Qnil;
break;
}

Expand Down
3 changes: 2 additions & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
--extout="$(EXTOUT)" \
--mflags="$(MFLAGS)" \
--make-flags="$(MAKEFLAGS)"
EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) --
EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) \
--make-flags="MINIRUBY='$(MINIRUBY)'" --
INSTRUBY_ARGS = $(SCRIPT_ARGS) \
--data-mode=$(INSTALL_DATA_MODE) \
--prog-mode=$(INSTALL_PROG_MODE) \
Expand Down
9 changes: 7 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ then
AC_MSG_ERROR(cached CC is different -- throw away $cache_file
(it is also a good idea to do 'make clean' before compiling))
fi
test -z "$CC" || ac_cv_prog_CC="$CC"

if test "$program_prefix" = NONE; then
program_prefix=
Expand Down Expand Up @@ -1131,7 +1132,6 @@ AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl

STATIC=
: ${LIBPATHFLAG=' -L%s'}
: ${PATHFLAG=''}

if test "$with_dln_a_out" != yes; then
Expand Down Expand Up @@ -1161,7 +1161,6 @@ if test "$with_dln_a_out" != yes; then
[ --disable-rpath embed run path into extension libraries.],
[enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
if test "$enable_rpath" = yes; then
LIBPATHFLAG=" -L%1\$-s"
RPATHFLAG=" ${linker_flag}-R%1\$-s"
fi

Expand Down Expand Up @@ -1283,6 +1282,12 @@ if test "$with_dln_a_out" != yes; then
esac
AC_MSG_RESULT($rb_cv_dlopen)
fi
case ${RPATHFLAG} in
*'%1$'*)
: ${LIBPATHFLAG=' -L%1$-s'};;
*)
: ${LIBPATHFLAG=' -L%s'};;
esac
AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
AC_SUBST(RPATHFLAG)
Expand Down
14 changes: 9 additions & 5 deletions enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,11 +667,11 @@ first_i(i, ary)
else {
long n = NUM2LONG(ary[0]);

rb_ary_push(ary[1], i);
n--;
if (n <= 0) {
rb_iter_break();
}
rb_ary_push(ary[1], i);
n--;
ary[0] = INT2NUM(n);
}
return Qnil;
Expand Down Expand Up @@ -700,9 +700,12 @@ enum_first(argc, argv, obj)
ary[0] = ary[1] = Qnil;
}
else {
long len;
rb_scan_args(argc, argv, "01", &n);
ary[0] = n;
ary[1] = rb_ary_new2(NUM2LONG(n));
len = NUM2LONG(n);
if (len == 0) return rb_ary_new2(0);
ary[0] = INT2NUM(len);
ary[1] = rb_ary_new2(len);
}
rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)ary);

Expand Down Expand Up @@ -1609,8 +1612,8 @@ take_i(i, arg)
VALUE i;
VALUE *arg;
{
if (arg[1]-- == 0) rb_iter_break();
rb_ary_push(arg[0], i);
if (--arg[1] == 0) rb_iter_break();
return Qnil;
}

Expand All @@ -1637,6 +1640,7 @@ enum_take(obj, n)
rb_raise(rb_eArgError, "attempt to take negative size");
}

if (len == 0) return rb_ary_new2(0);
args[1] = len;
args[0] = rb_ary_new();
rb_block_call(obj, id_each, 0, 0, take_i, (VALUE)args);
Expand Down
Loading

0 comments on commit 60593a7

Please sign in to comment.