| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
* internal.h: Ditto.
* marshal.c: Ditto.
* rational.c: Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
GH-570] [ci skip]
* object.c, rational.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
| |
* complex.c, rational.c: remove unused functions, which are warned
by clang 5.1, and also variables only used by removed functions.
* ext/date/date_core.c: ditto.
* enc/utf_16be.c, enc/utf_16le.c: comment out constants only used
by commented out functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(BIGNUM_EMBED_LEN_NUMBITS): Renamed from RBIGNUM_EMBED_LEN_NUMBITS.
(BIGNUM_EMBED_LEN_MAX): Renamed from RBIGNUM_EMBED_LEN_MAX.
(BIGNUM_SIGN_BIT): Renamed from RBIGNUM_SIGN_BIT.
(BIGNUM_SIGN): Renamed from RBIGNUM_SIGN.
(BIGNUM_SET_SIGN): Renamed from RBIGNUM_SET_SIGN.
(BIGNUM_POSITIVE_P): Renamed from RBIGNUM_POSITIVE_P.
(BIGNUM_NEGATIVE_P): Renamed from RBIGNUM_NEGATIVE_P.
(BIGNUM_EMBED_FLAG): Renamed from RBIGNUM_EMBED_FLAG.
(BIGNUM_EMBED_LEN_MASK): Renamed from RBIGNUM_EMBED_LEN_MASK.
(BIGNUM_EMBED_LEN_SHIFT): Renamed from RBIGNUM_EMBED_LEN_SHIFT.
(BIGNUM_LEN): Renamed from RBIGNUM_LEN.
(RBIGNUM_DIGITS): Renamed from RBIGNUM_DIGITS.
(BIGNUM_LENINT): Renamed from RBIGNUM_LENINT.
* bignum.c: Follow the above change.
* gc.c: Ditto.
* marshal.c: Ditto.
* math.c: Ditto.
* numeric.c: Ditto.
* random.c: Ditto.
* rational.c: Ditto.
* sprintf.c: Ditto.
* ext/-test-/bignum/bigzero.c: Ditto.
* ext/-test-/bignum/intpack.c: Ditto.
* ext/bigdecimal/bigdecimal.c: Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* rational.c (nurat_div): reverted r28844, r28886 and r28887.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c (numeric_quo): variable 'canonicalization' is defined
conditionally by CANON (and CANONICALIZATION_FOR_MATHN).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c, rational.c: use RB_TYPE_P() for special classes instead
of switch with TYPE().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GMP_GCD_DIGITS): New macro.
(rb_gcd_gmp): New function.
(f_gcd_normal): Renamed from f_gcd.
(rb_gcd_normal): New function.
(f_gcd): Invoke rb_gcd_gmp or f_gcd_normal.
* internal.h (rb_gcd_normal): Declared.
(rb_gcd_gmp): Ditto.
* ext/-test-/rational: New directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to rationalize a Float instance with a precision.
* rational.c (rb_flt_rationalize): new public C function to
rationalize a Float instance. A precision is calculated from
the given float number.
* include/ruby/intern.h: Add rb_flt_rationalize_with_prec and
rb_flt_rationalize.
* parse.y: implement number literal suffixes, 'r' and 'i'.
[ruby-core:55096] [Feature #8430]
* bootstraptest/test_literal_suffix.rb: add tests for parser to scan
number literals with the above tsuffixes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* rational.c (f_round_common): Rational is expected to be returned by
Rational#*, but mathn.rb breaks that assumption. [ruby-core:56177]
[Bug #8687]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
in rational.c to refer canonicalization state for mathn support.
[ruby-core:41575] [Bug #5736]
* numeric.c (num_quo): ditto.
* test/test_mathn.rb: add a test for the change at r41109.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c (f_inspect, f_to_s): use existing functions, rb_inspect
and rb_obj_as_string respectively.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See this ticet about RGENGC.
* gc.c: Add several flags:
* RGENGC_DEBUG: if >0, then prints debug information.
* RGENGC_CHECK_MODE: if >0, add assertions.
* RGENGC_PROFILE: if >0, add profiling features.
check GC.stat and GC::Profiler.
* include/ruby/ruby.h: disable RGENGC by default (USE_RGENGC == 0).
* array.c: add write barriers for T_ARRAY and generate sunny objects.
* include/ruby/ruby.h (RARRAY_PTR_USE): added. Use this macro if
you want to access raw pointers. If you modify the contents which
pointer pointed, then you need to care write barrier.
* bignum.c, marshal.c, random.c: generate T_BIGNUM sunny objects.
* complex.c, include/ruby/ruby.h: add write barriers for T_COMPLEX
and generate sunny objects.
* rational.c (nurat_s_new_internal), include/ruby/ruby.h: add write
barriers for T_RATIONAL and generate sunny objects.
* internal.h: add write barriers for RBasic::klass.
* numeric.c (rb_float_new_in_heap): generate sunny T_FLOAT objects.
* object.c (rb_class_allocate_instance), range.c:
generate sunny T_OBJECT objects.
* string.c: add write barriers for T_STRING and generate sunny objects.
* variable.c: add write barriers for ivars.
* vm_insnhelper.c (vm_setivar): ditto.
* include/ruby/ruby.h, debug.c: use two flags
FL_WB_PROTECTED and FL_OLDGEN.
* node.h (NODE_FL_CREF_PUSHED_BY_EVAL, NODE_FL_CREF_OMOD_SHARED):
move flag bits.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RComplex::(real,imag).
Add macro to set these values:
* RRATIONAL_SET_NUM()
* RRATIONAL_SET_DEN()
* RCOMPLEX_SET_REAL()
* RCOMPLEX_SET_IMAG()
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
TODO: API design. RRATIONAL_SET(rat,num,den) is enough?
TODO: Setting constify variable with cast has same issue of r40691.
* complex.c, rational.c: use above macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
instead of using RARRAY_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(MUL_OVERFLOW_FIXNUM_P): Ditto.
(MUL_OVERFLOW_LONG_P): Ditto.
* array.c (rb_ary_product): Don't overflow on signed integer
multiplication.
* numeric.c (fix_mul): Ditto.
(int_pow): Ditto.
* rational.c (f_imul): Ditto.
* insns.def (opt_mult): Ditto.
* thread.c (sleep_timeval): Don't overflow on signed integer addition.
* bignum.c (rb_int2big): Don't overflow on signed integer negation.
(rb_big2ulong): Ditto.
(rb_big2long): Ditto.
(rb_big2ull): Ditto.
(rb_big2ll): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bignum.c: ditto
* file.c: ditto
* object.c: ditto
* numeric.c: ditto
* rational.c: ditto
* string.c: ditto
* time.c: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
[bug #5713] [bug #5715]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* marshal.c (w_object): dump instance varialbes of the result of
marshal_dump not the original object. [ruby-core:51163] [Bug #7627]
* complex.c (nucomp_marshal_dump): need to copy instance variables.
* rational.c (nurat_marshal_dump): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* random.c (Init_Random), rational.c (Init_Rational): make marshal
methods private. [Feature #6539]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c (string_to_r_strict, string_to_r): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c (read_num): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c (string_to_r_strict, string_to_r): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* ratioanl.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
VALUE rb_newobj_of(VALUE klass, VALUE flags)
#define NEWOBJ_OF(obj,type,klass,flags)
These allow to change a allocation strategy depending on klass
or flags.
* gc.c: ditto
* array.c: use new C API.
* bignum.c: ditto
* class.c: ditto
* complex.c: ditto
* ext/socket/ancdata.c: ditto
* ext/socket/option.c: ditto
* hash.c: ditto
* io.c: ditto
* marshal.c: ditto
* numeric.c: ditto
* object.c: ditto
* random.c: ditto
* range.c: ditto
* rational.c: ditto
* re.c: ditto
* string.c: ditto
* struct.c: ditto
[Feature #7177][Feature #7047]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* complex.c, rational.c: compatible marshal loader for compatibilities
with 1.8. [ruby-core:45775] [Bug #6625]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* complex.c: ditto.
* rational.c: ditto.
* include/ruby/intern.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
But now disabled. [experimental]
* complex.c: followed the above.
* rational.c: ditto.
* include/rub/intern.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* marshal.c: revert r35879 "now marshal_{load|dump} are external."
* complex.c (nucomp_marshal__{dump,load}): should use rb_marshal_{dump,load}.
* rational.c (nurat_marshal__{dump,load}): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
disabled (due to compatibility) [experimental].
* rational.c: wrote Rational#_dump and Rational::load. ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* rational.c (nurat_marshal_load): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
reported by John Firebaugh [ruby-core:42860] [Bug #6076]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
comparison with TYPE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
into Complex if the argument is a Complex with non-zero imaginary
part. [Bug #5020] [ruby-dev:44088]
* test/ruby/test_rational.rb (test_coerce): test for the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* rational.c (string_to_r_internal): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|