aboutsummaryrefslogtreecommitdiffstats
path: root/include/ruby/ruby.h
Commit message (Collapse)AuthorAgeFilesLines
* ruby.h: RB_INTEGER_TYPE_Pnobu2016-05-181-0/+9
| | | | | | | | * include/ruby/ruby.h (RB_INTEGER_TYPE_P): new macro and underlying inline function to check if the object is an Integer (Fixnum or Bignum). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [Feature #12005] Unify Fixnum and Bignum into Integerakr2016-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [Feature #12005] Unify Fixnum and Bignum into Integer * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums. * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG. * vm_core.h: Ditto. * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead of FIXNUM_REDEFINED_OP_FLAG. * vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of rb_cFixnum and rb_cBignum. (C): Use Integer instead of Fixnum and Bignum. * numeric.c (fix_succ): Removed. (Init_Numeric): Define Fixnum as Integer. * bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum. (rb_int_coerce): replaced from rb_big_coerce and return fixnums as-is. (Init_Bignum): Define Bignum as Integer. Don't define ===. * error.c (builtin_class_name): Return "Integer" for fixnums. * sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum. * ext/-test-/testutil: New directory to test. Currently it provides utilities for fixnum and bignum. * ext/json/generator/generator.c: Define mInteger_to_json. * lib/mathn.rb (Fixnum#/): Redefinition removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/defines.h (GCC_VERSION_SINCE): moved from internal.hnaruse2016-05-121-12/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/{defines,ruby}.h: need to define function attributesusa2016-05-081-38/+0
| | | | | | | | | alternatives in defines.h instead of ruby.h, because they are used in oniguruma.h and the header used without including ruby.h at encoding library sources. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONSTFUNC, PUREFUNC): fixed build errors onusa2016-05-081-0/+6
| | | | | | | non-gcc build environments introduced at r54952. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: check function attirbute const and pure,naruse2016-05-081-3/+3
| | | | | | | | | | | | and define CONSTFUNC and PUREFUNC if available. Note that I don't add those options as default because it still shows many false-positive (it seems not to consider longjmp). * vm_eval.c (stack_check): get rb_thread_t* as an argument to avoid duplicate call of GET_THREAD(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: add -Wsuggest-attribute=noreturn and suppress warnings.naruse2016-05-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_mul_size_overflow): use UNLIKELYnaruse2016-04-231-2/+2
| | | | | | by user side to improve generallity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (RB_LIKELY): use prefix in ruby.h.naruse2016-04-231-9/+9
| | | | | | * intern.h (LIKELY): define with RB_LIKELY. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_mul_size_overflow): added to handlenaruse2016-04-221-9/+20
| | | | | | | | | | | mul overflow efficiently. * include/ruby/ruby.h (rb_alloc_tmp_buffer2): use rb_mul_size_overflow and avoid division where it can define DSIZE_T. * gc.c (xmalloc2_size): moved from ruby.h and use rb_mul_size_overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c: use uint32_t instead of long to avoid confusion aboutnaruse2016-04-221-1/+1
| | | | | | the type of ivtbl->numiv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_alloc_tmp_buffer_with_count): added like xmalloc2 tonaruse2016-04-211-3/+21
| | | | | | | | | | | avoid duplicated check of size. * gc.c (ruby_xmalloc2): added to keep separate layers. * include/ruby/ruby.h (rb_alloc_tmp_buffer2): added to check the size more statically. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (LIKELY): moved from internal.h.naruse2016-04-211-0/+9
| | | | | | * include/ruby/ruby.h (UNLIKELY): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (objspace_malloc_prepare): remove size check because it isnaruse2016-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | used by objspace_xmalloc and objspace_xcalloc. objspace_xmalloc introduces its own check in this commit. objspace_xcalloc checks with xmalloc2_size (ruby_xmalloc2_size). * gc.c (objspace_xmalloc0): common xmalloc function. * gc.c (objspace_xmalloc): introduce its own size check. * gc.c (objspace_xmalloc2): separated from ruby_xmalloc2 to clarify the layer who has the responsibility to check the size. * gc.c (objspace_xrealloc): remove duplicated size check. * gc.c (ruby_xmalloc2): use objspace_xmalloc2. * include/ruby/ruby.h (ruby_xmalloc2_size): follow the size limit as SSIZE_MAX. Note that ISO C says size_t is unsigned integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_isupper, rb_islower, rb_isalpha, rb_isdigit,naruse2016-03-291-29/+28
| | | | | | | | | | | rb_isalnum, rb_isxdigit, rb_isblank, rb_isspace, rb_isblank, rb_iscntrl, rb_isprint, rb_ispunct, rb_isgraph, rb_tolower, rb_toupper): use inline function to avoid function call. * include/ruby/ruby.h (rb_isascii): use inline function to clarify the logic. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: remove RB_GC_GUARD_PTRnobu2016-03-171-12/+4
| | | | | | | * 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
* * re.c: Introduce RREGEXP_PTR.naruse2016-02-021-1/+2
| | | | | | | | | | | | | | | | | 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
* * ruby.h: undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_Pmrkn2016-01-071-0/+7
| | | | | | | 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
* version.c: no exit in ruby_show_copyrightnobu2016-01-071-0/+4
| | | | | | | | | | * 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
* rb_readwrite_syserr_failnobu2015-12-231-5/+7
| | | | | | | * 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
* * include/ruby/ruby.h (RB_OBJ_TAINT): follow-up of r52881.ngoto2015-12-041-1/+1
| | | | | | | | | 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
* ruby.h: make flag setting macros voidnobu2015-12-041-8/+8
| | | | | | | | * 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
* * include/ruby/ruby.h (RSTRUCT_PTR): need a close parenthese.ko12015-11-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_array_const_ptr, rb_struct_const_ptr):ngoto2015-11-061-4/+12
| | | | | | | | | | | | 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
* include/ruby/ruby.h (struct RObject): hide iv_index_tbl typenormal2015-11-031-1/+1
| | | | | | | | | | | | | | 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
* * gc.c: introduce rb_wb_unprotected_newobj_of() andko12015-10-291-1/+1
| | | | | | | | | | | | | | | | 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
* disable warnings unless optimizednobu2015-10-181-1/+1
| | | | | | | * 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
* disable warnings unless optimizednobu2015-10-181-0/+6
| | | | | | | | * 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
* ruby.h: RB_OBJ_FROZEN_RAWnobu2015-10-071-1/+3
| | | | | | | * 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
* ruby.h: inlinesnobu2015-10-061-33/+70
| | | | | | | * include/ruby/ruby.h: turn function macros into inline functions, for debuggers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: enumsnobu2015-10-061-64/+104
| | | | | | | * include/ruby/ruby.h: turn constant macros into enums, for debuggers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: RUBY_FL_PROMOTEDnobu2015-09-161-0/+1
| | | | | | | * include/ruby/ruby.h (ruby_fl_type): revive RUBY_FL_PROMOTED for .gdbinit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: add prefixnobu2015-09-131-201/+341
| | | | | | | | * include/ruby/ruby.h: prefix RUBY or RB to global symbols to get rid of name conflicts with other headers. * include/ruby/encoding.h, include/ruby/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: eval ASSUME argumentnobu2015-09-051-1/+1
| | | | | | | * include/ruby/ruby.h (ASSUME): evaluate the argument just once everywhere. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h, cont.c, vm_trace.c: add a new eventko12015-08-211-0/+1
| | | | | | | | | | | fiber_switch. We need more discussion about this feature so that I don't write it on NEWS. [Feature #11348] * test/ruby/test_settracefunc.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: define RClass only in Cnobu2015-08-181-2/+4
| | | | | | | | * include/ruby/ruby.h (RClass): define only in C, `__attribute__` between `struct` and the name can't compile with g++. [ruby-core:70297] [Bug #11426] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: adjust for g++nobu2015-08-181-2/+2
| | | | | | | * include/ruby/ruby.h (RClass): move `__attribute__` after the keyword `struct` for g++. [ruby-core:70297] [Bug #11426] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: check integer overflownobu2015-08-111-2/+19
| | | | | | | * include/ruby/ruby.h (ALLOCV_N): check integer overflow, as well as ruby_xmalloc2. pointed out by Paul <pawlkt AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: moved RClassnobu2015-07-281-7/+6
| | | | | | | * internal.h (struct RClass): moved from ruby/ruby.h to hide the internals. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: taint flagsnobu2015-07-231-5/+13
| | | | | | | | | * include/ruby/ruby.h: add raw FL macros, which assume always the argument object is not a special constant. * internal.h (STR_EMBED_P, STR_SHARED_P): valid only for T_STRING. * string.c: deal with taint flags directly across String instances. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: ASSUMEnobu2015-07-221-1/+8
| | | | | | | * include/ruby/ruby.h (ASSUME): hint for optimization, the expression is assumed to be true always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* $SAFE=2 is now obsoletenobu2015-06-181-2/+2
| | | | | | | | | * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): fix safe_level limit. * vm_core.h (rb_proc_t): update comment for safe_level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: $SAFE=2 is now obsolete.hsbt2015-06-181-4/+4
| | | | | | | | | | * dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c gc.c, io.c, process.c, safe.c, signal.c, win32/file.c: removed code for $SAFE=2 * test/erb/test_erb.rb, test/fiddle/test_handle.rb test/ruby/test_env.rb: removed tests for $SAFE=2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: $SAFE=3 is now obsolete.hsbt2015-06-171-6/+6
| | | | | | | | | | | * ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code for $SAFE=3 * bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb test/ruby/test_thread.rb: remove tests for $SAFE=3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: warn old namesnobu2015-05-201-2/+18
| | | | | | | * include/ruby/ruby.h (rb_data_typed_object_alloc), (rb_data_object_alloc): warn use of old names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: DEPRECATED_BYnobu2015-05-201-0/+3
| | | | | | | * include/ruby/ruby.h (DEPRECATED_BY): fallback definition without additional messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: add old namesnobu2015-05-191-0/+2
| | | | | | | | | | * include/ruby/ruby.h (rb_data_typed_object_alloc), (rb_data_object_alloc): add old names for source level backward compatibilities. * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc): add aliases for binary level backward compatibilities. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: cast for C++nobu2015-05-191-1/+3
| | | | | | | * include/ruby/ruby.h (Data_Make_Struct0): needs function pointer casts to fix function overloading in C++. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: cast for C++nobu2015-05-191-8/+8
| | | | | | | | * include/ruby/ruby.h (Data_Make_Struct0, TypedData_Make_Struct0): explicit cast from void* is necessary as implicit cast is disallowed in C++. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: rename alloc as wrapnobu2015-05-161-20/+20
| | | | | | | | * gc.c (rb_data_object_wrap, rb_data_typed_object_wrap): rename alloc as wrap. these functions do not allocate data pointers but just wrap the given pointers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e