Граф коммитов

1238 Коммитов

Автор SHA1 Сообщение Дата
mrkn fa860a9497 * include/ruby/intern.h (rb_big_odd_p, rb_big_even_p): move to
internal.h so that they are exported only for ruby itself.

* internal.h (rb_big_odd_p, rb_big_even_p): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-19 16:08:52 +00:00
mrkn 2897eb11a0 * include/ruby/intern.h (rb_big_hash): Move to internal.h.
* internal.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-18 13:33:42 +00:00
mrkn f8e79c84a9 * bignum.c (rb_big_hash): make it public function to be available in
other source files, and remove documentation comment for Bignum#hash.

* bignum.c (Bignum#hash): remove its definition because it is unified
  with Object#hash.

* include/ruby/intern.h (rb_big_hash): add a prototype declaration.

* hash.c (any_hash): treat Bignum values directly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-18 01:22:38 +00:00
mrkn a3c9cda6d7 * bignum.c (rb_big_even_p, rb_big_odd_p): make them public functions
to be available in other source files.

* include/ruby/intern.h (rb_big_even_p, rb_big_odd_p): add prototype
  declarations.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-17 17:07:29 +00:00
nobu 37153c03f8 ruby.h: remove RB_GC_GUARD_PTR
* include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate
  macro, and expand for each RB_GC_GUARD.  [Fix GH-1293]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-17 13:21:36 +00:00
duerst 4b15b54d68 * include/ruby/oniguruma.h, enc/unicode.c: Adjusting flag assignments
and macros to work with unified CaseMappingSpecials array.
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-14 09:39:54 +00:00
nobu e13db770f4 win32.h: fix O_SHARE_DELETE
* include/ruby/win32.h (O_SHARE_DELETE): change to fit Fixnum
  limit.  [ruby-core:74285] [Bug #12171]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-13 00:43:25 +00:00
nobu 8e1a0856ed internal.h: functions for class internals
* internal.h: move function declarations for class internals from
  include/ruby/intern.h.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-07 04:28:32 +00:00
svn 35f40f5347 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-24 13:32:02 +00:00
duerst f1f48e6103 * include/ruby/oniguruma.h: Rearranging flag assignments and making
space for titlecase indices; adding additional macros to add or
  extract titlecase index; adding comments for better documentation.
* enc/unicode.c: Moving some macros to include/ruby/oniguruma.h;
  activating use of titlecase indices.
  (with Kimihito Matsui)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-24 13:32:01 +00:00
nobu 383555fe44 encoding.h: rb_enc_asciicompat_inline
* include/ruby/encoding.h (rb_enc_asciicompat): turn into an
  inline function to get rid of evalucating the argument twice.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-04 03:16:50 +00:00
naruse 21daa56b2a * re.c: Introduce RREGEXP_PTR.
patch by dbussink.
  partially merge https://github.com/ruby/ruby/pull/497

* include/ruby/ruby.h: ditto.

* gc.c: ditto.

* ext/strscan/strscan.c: ditto.

* parse.y: ditto.

* string.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02 04:39:44 +00:00
nobu fd7b490fc3 disable unaligned word access
* include/ruby/defines.h, st.c: disable unaligned word access with
  gcc 6 or later.  [Bug #11831]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-15 13:15:39 +00:00
duerst eb86cd6b7b include/ruby/oniguruma.h: Added flags needed for upcase/downcase
Unicode addition (with Kimihito Matsui)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-11 12:28:55 +00:00
nobu d138a11095 io.h: remove old macros
* include/ruby/io.h (RB_IO_BUFFER_INIT, RB_IO_FPTR_NEW): remove
  old macros only for internal use and obsolete since 2.2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-11 00:01:12 +00:00
nobu 09bdb7913c missing.h: remove explicit_bzero_by_memset_s
* include/ruby/missing.h (explicit_bzero_by_memset_s): remove
  inline implementation by memset_s, which needs a macro before
  including headers and can cause problems in extension libraries
  by the order of the macro and headers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-10 06:45:36 +00:00
mrkn 98e565ec78 * ruby.h: undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
and HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P on C++.
  [ruby-core:72736] [Bug #11962]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-07 13:35:32 +00:00
nobu 7aab062ef3 version.c: no exit in ruby_show_copyright
* include/ruby/backward.h (ruby_show_copyright_to_die): for source
  code backward compatibility.
* ruby.c (process_options): return Qtrue to exit the process
  successfully.
* version.c (ruby_show_copyright): no longer exit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-07 02:34:33 +00:00
matz fe2123f3ec version.h (RUBY_VERSION): 2.4.0 development has started.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-25 12:40:38 +00:00
duerst 0ab9e70625 doc/CangeLog-2.3.0, ext/tk/lib/txextlib/SUPPORT_STATUS,
include/ruby/version.h: minor grammar fixes [ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-25 05:12:16 +00:00
nobu 22d8481f08 fix common misspelling [ci skip]
* compile.c, cont.c, doc, man: fix common misspelling.
  [ruby-core:72466] [Bug #11870]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-24 23:23:46 +00:00
nobu 94090b0502 deprecate exposed internal functions
* error.c (rb_compile_error_with_enc, rb_compile_error),
  (rb_compile_bug): deprecate internal functions.
* parse.y (parser_yyerror): construct exception message with
  source code and carret.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-24 09:43:22 +00:00
nobu f9adadc5e6 rb_readwrite_syserr_fail
* io.c (rb_readwrite_syserr_fail): works with the given errno than
  thread local errno.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23 14:58:47 +00:00
normal a2e025a7d0 introduce rb_autoload_str to replace rb_autoload
rb_autoload_str may be safer by preventing premature GC.  It
can also be more efficient by passing a pre-frozen string that
can be deduped using rb_fstring.  Common autoload callers (e.g.
rubygems, rdoc) already use string literals as the file
argument.

There seems to be no reason to expose rb_autoload_str to the
public C API since autoload is not performance-critical.
Applications may declare autoloads in Ruby code or via
rb_funcall; so merely deprecate rb_autoload without exposing
rb_autoload_str to new users.

Running: valgrind -v ruby -rrdoc -rubygems -e exit
shows a minor memory reduction (32-bit userspace)

before:

  in use at exit: 1,600,621 bytes in 28,819 blocks
total heap usage: 55,786 allocs, 26,967 frees, 6,693,790 bytes allocated

after:

  in use at exit: 1,599,778 bytes in 28,789 blocks
total heap usage: 55,739 allocs, 26,950 frees, 6,692,973 bytes allocated

* include/ruby/intern.h (rb_autoload): deprecate
* internal.h (rb_autoload_str): declare
* load.c (rb_mod_autoload): use rb_autoload_str
* variable.c (rb_autoload): become compatibility wrapper
  (rb_autoload_str): hoisted out from old rb_autoload
  [ruby-core:71369] [Feature #11664]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 12:28:09 +00:00
ngoto bc9ac3ab7f * include/ruby/ruby.h (RB_OBJ_TAINT): follow-up of r52881.
Turn into void expression not to use unexpected result.
  Fix "operands have incompatible types" error with
  Oracle Solaris Studio 12.x on Solaris.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-04 15:59:10 +00:00
nobu 7eb6942dbb ruby.h: make flag setting macros void
* include/ruby/ruby.h (RB_FL_{SET,UNSET,REVERSE,INFECT,FREEZE}):
  turn into void expressions not to use unexpected results.  these
  macros were statements till 2.2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-04 07:32:05 +00:00
nobu bc6e31eebf missing.h: __STDC_WANT_LIB_EXT1__
* include/ruby/missing.h: get rid of redefinition of
  __STDC_WANT_LIB_EXT1__.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-02 09:17:42 +00:00
nobu 4a7dedf7f0 missing.h: __STDC_WANT_LIB_EXT1__
* include/ruby/missing.h: __STDC_WANT_LIB_EXT1__ is necessary for
  memset_s.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-02 01:50:34 +00:00
nobu 24dcb1285d explicit_bzero.c: needs windows.h
* missing/explicit_bzero.c, random.c (explicit_bzero):
  SecureZeroMemory() needs windows.h.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01 03:52:20 +00:00
nobu e84000fcba missing.h: explicit_bzero by SecureZeroMemory
* include/ruby/missing.h (explicit_bzero): use SecureZeroMemory on
  Windows.  assume Windows XP or later at compile time.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01 01:39:24 +00:00
nobu 10bb9e6fab missing.h: explicit_bzero by memset_s
* include/ruby/missing.h (explicit_bzero_by_memset_s): call
  memset_s directly if available.

* missing/explicit_bzero.c: optimization is not a matter if
  memset_s is available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01 01:24:23 +00:00
nobu ff113d52f7 configure.in: FUNC_UNOPTIMIZED
* configure.in: check if optimize pragma is supported.

* include/ruby/defines.h (FUNC_UNOPTIMIZED): fallback definition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01 01:05:48 +00:00
kosaki 86caaefc1f * include/ruby/util.h: remove a warning suppression C4723
(potential divide by zero) for VisualC++. It's meaningless.
  Before r26197, there is ruby_div0() in this place and it
  actually made divide by zero. But now it's just garbage.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:27:52 +00:00
kosaki dea685c783 * missing/explicit_bzero.c: new file. define explicit_bzero.
* common.mk: add a rule for explicit.o.
* configure.in: detect explicit_bzero and memset_s.
* include/ruby/missing.h: add explicit_bzero.
* random.c (init_randomseed): use explicit_bzero() instead of
  memset(). memset could be eliminated by compiler optimization.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:26:13 +00:00
nobu 13a935b0ba Drop support for BeOS
* beos: Drop support for BeOS now that Haiku is stable.
  [Fix GH-1112]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-24 00:17:11 +00:00
nobu e29c109d2a Haiku now best effort support
* configure.in: remove obsolete workarounds for Haiku.
* dln.c, file.c, io.c: remove obsolete Haiku workarounds.
* thread_pthread.c: add stack bounds detection for Haiku.
* signal.c: get stack pointer from signal context on Haiku.
  [ruby-core:67923] [Bug #10811] [Fix GH-1109]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23 03:54:42 +00:00
naruse f1df08e76d * time.c (rb_timespec_now): added.
* time.c (rb_time_timespec_new): added.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-10 02:59:47 +00:00
ko1 92861a1163 * include/ruby/ruby.h (RSTRUCT_PTR): need a close parenthese.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-06 18:35:29 +00:00
ngoto fcf63d1e54 * include/ruby/ruby.h (rb_array_const_ptr, rb_struct_const_ptr):
Suppress pointer type mismatch warnings occurred with old version
  of Fujitsu C Compiler (fcc) on Solaris 10. The warnings cause
  failure of TestMkmf::TestConvertible. [Bug #11644] [ruby-dev:49326]
* include/ruby/ruby.h (FIX_CONST_VALUE_PTR): macro for the above,
  only effective with fcc.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-06 09:19:14 +00:00
normal 2f418fb363 include/ruby/ruby.h (struct RObject): hide iv_index_tbl type
This is an implementation detail and should not be exposed to
C extension users.  We may change this to id_table soon; and
id_table should not be exposed as a public API.

It is highly unlikely any existing C extensions require this;
so the risk of breakage is very low.  Ideally, all of RObject
could be hidden.

[ruby-core:71306] [Feature #11647]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-03 21:16:48 +00:00
ko1 ffa87b4057 * gc.c: introduce rb_wb_unprotected_newobj_of() and
rb_wb_protected_newobj_of(), pass the WB_PROTECTED
  information explicitly.

* internal.h: use introduced functions by NEWOBJ_OF().
  `flag' is immediate value, so that C compilers can
  solve them at compile time.

* include/ruby/ruby.h: add a commnent about that.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-29 07:26:44 +00:00
nobu 96003bc9ac missing.h: fix condition
* include/ruby/missing.h (bytesequence4_or_float): define by
  configured result.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-20 07:15:16 +00:00
nobu 603cdc2710 check INFINITY and NAN without C99 option
* configure.in: check INFINITY and NAN without an option for C99
  so that rb_infinity and rb_nan are respectively available
  regardless that option if they may be used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-19 16:29:31 +00:00
nobu 4eba615a0b disable warnings unless optimized
* include/ruby/ruby.h (rb_data_object_{wrap,get}): move
  declarations inside ifdef too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18 10:21:35 +00:00
nobu 6094ac4ce8 disable warnings unless optimized
* include/ruby/ruby.h (rb_data_object_{wrap,get,make}): warn only
  if optimized, as __builtin_choose_expr() does not work fine
  unless optimized.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18 05:53:26 +00:00
kosaki 0bdf13a104 * include/ruby/backward/util.h: Good-by Borland-C.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18 05:41:34 +00:00
kosaki 3a48e12607 * numeric.c: Good-by Borland-C.
* include/ruby/backward/rubyio.h: ditto.
* include/ruby/backward/st.h: ditto.
* include/ruby/backward/util.h: ditto.
* include/ruby/backward/rubysig.h: ditto.
* include/ruby/backward/classext.h: ditto.
* dln.c: ditto.
* gc.c: ditto.
* win32/resource.rb: ditto.
* win32/dir.h: ditto.
* ext/tk/tcltklib.c: ditto.
* NEWS: announce that Borland-C is no longer supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18 02:10:34 +00:00
kosaki 4ad2057f27 * ChangeLog: Good-bye OS/2.
* common.mk: ditto.
* configure.in: ditto.
* dln_find.c: ditto.
* ext/Setup.emx: ditto.
* ext/extmk.rb: ditto.
* ext/socket/extconf.rb: ditto.
* ext/zlib/extconf.rb: ditto.
* file.c: ditto.
* include/ruby/defines.h: ditto.
* io.c: ditto.
* lib/mkmf.rb: ditto.
* missing/os2.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* NEWS: announce OS/2 is no longer supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18 01:18:34 +00:00
kosaki 6803c4e2a8 * include/ruby/defines.h (DOSISH): add comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18 01:17:50 +00:00
nobu d250a33062 ruby.h: RB_OBJ_FROZEN_RAW
* include/ruby/ruby.h (RB_OBJ_FROZEN_RAW): split from
  RB_OBJ_FROZEN.  valid only for non-special-const objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-07 12:40:34 +00:00