summaryrefslogtreecommitdiff
path: root/include/ruby/ruby.h
AgeCommit message (Collapse)Author
2015-10-07ruby.h: RB_OBJ_FROZEN_RAWnobu
* 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-06ruby.h: inlinesnobu
* 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
2015-10-06ruby.h: enumsnobu
* 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
2015-09-16ruby.h: RUBY_FL_PROMOTEDnobu
* 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
2015-09-13ruby.h: add prefixnobu
* 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
2015-09-05ruby.h: eval ASSUME argumentnobu
* 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
2015-08-21* include/ruby/ruby.h, cont.c, vm_trace.c: add a new eventko1
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
2015-08-18ruby.h: define RClass only in Cnobu
* 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
2015-08-18ruby.h: adjust for g++nobu
* 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
2015-08-11ruby.h: check integer overflownobu
* 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
2015-07-28internal.h: moved RClassnobu
* 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
2015-07-23string.c: taint flagsnobu
* 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
2015-07-22ruby.h: ASSUMEnobu
* 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
2015-06-18$SAFE=2 is now obsoletenobu
* 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
2015-06-18* include/ruby/ruby.h: $SAFE=2 is now obsolete.hsbt
* 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
2015-06-17* include/ruby/ruby.h: $SAFE=3 is now obsolete.hsbt
* 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
2015-05-20ruby.h: warn old namesnobu
* 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
2015-05-20ruby.h: DEPRECATED_BYnobu
* 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
2015-05-19ruby.h: add old namesnobu
* 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
2015-05-19ruby.h: cast for C++nobu
* 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
2015-05-19ruby.h: cast for C++nobu
* 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
2015-05-16gc.c: rename alloc as wrapnobu
* 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
2015-05-11ruby.h: suppress warningsnobu
* include/ruby/ruby.h (Data_Make_Struct, TypedData_Make_Struct): make statement-expression to get rid of strict-aliasing warnings by old GCC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10ruby.h: fix possible memory leaknobu
* include/ruby/ruby.h (Data_Make_Struct, TypedData_Make_Struct): allocate wrapper data object before allocating DATA_PTR to get rid of possible memory leak when the former failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-17* include/ruby/ruby.h: use rb_gc_writebrrier() simply.ko1
For incremental GC, we need to get a pointer to the objspace. We can share this pointer for the following WB process. And considering icache hit ratio, prcess in the GC. * gc.c (rb_gc_writebarrier): added. * gc.c (gc_writebarrier_generational, gc_writebarrier_incremental): make them NOINLINE because inlining them into rb_gc_writebarrier() makes a prologue code of rb_gc_writebarrier() longer (storing callee save registers). This patch improve the performance of WB on micro-benchmarks. name ruby 2.1 trunk modified vm1_gc_wb_ary* 0.511 0.632 0.532 vm1_gc_wb_ary_promoted* 0.578 0.701 0.674 vm1_gc_wb_obj* 0.419 0.575 0.492 vm1_gc_wb_obj_promoted* 0.537 0.664 0.618 (sec) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-16ruby.h: suppress false warningsnobu
* include/ruby/ruby.h (rb_data_object_alloc_warning): enable only if __builtin_choose_expr works with __builtin_constant_p so that warnings will be suppressed if klass is 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* include/ruby/ruby.h: introduce new type T_IMEMO.ko1
T_IMEMO is Internal Memo type, internal use only. T_IMEMO has same purpose of NODE_MEMO. To insert T_IMEMO, type numbers are modified a little. * internal.h: define struct RIMemo. Each RIMemo objects has imemo_type. We can observe it by the imemo_type() function. * gc.c (rb_imemo_new): added. * node.h: remove NODE_CREF and NEW_CREF(). * node.c (rb_gc_mark_node): ditto. * vm.c (vm_cref_new): use rb_imem_new(). * vm_eval.c: ditto. * vm_eval.c (eval_string_with_cref): * vm_eval.c (rb_type_str): * vm_insnhelper.c: use RIMemo objects for CREF. * ext/objspace/objspace.c: support T_IMEMO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-05* internal.h: remove struct method_table_wrapper.ko1
struct method_table_wrapper was introduced to avoid duplicate marking for method tables. For example, `module M1; def foo; end; end` make one method table (mtbl) contains a method `foo`. M1 (T_MODULE) points mtbl. Classes C1 and C2 includes M1, then two T_ICLASS objects are created and they points mtbl too. In this case, three objects (one T_MODULE and two T_ICLASS objects) points same mtbl. On marking phase, these three objects mark same mtbl. To avoid such duplication, struct method_table_wrapper was introduced. However, created two T_ICLASS objects have same or shorter lifetime than M1 (T_MODULE) object. So that we only need to mark mtbl from M1, not from T_ICLASS objects. This patch tries marking only from M1. Note that one `Module#prepend` call creates two T_ICLASS objects. One for refering to a prepending Module object, same as `Module#include`. We don't nedd to care this T_ICLASS. One for moving original mtbl from a prepending class. We need to mark such mtbl from this T_ICLASS object. To mark the mtbl, we need to use `RCLASS_ORIGIN(klass)` on marking from a prepended class `klass`. * class.c: ditto. * eval.c (rb_using_refinement): ditto. * gc.c: ditto. * include/ruby/ruby.h: define m_tbl directly. The definition of struct RClass should be moved to (srcdir)/internal.h. * method.h: remove decl of rb_free_m_tbl_wrapper(). * object.c: use RCLASS_M_TBL() directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24ruby.h: parent in rb_data_type_tnobu
* ruby.h (rb_data_type_t): revert r48647 and revise parent member. [ruby-core:66969] [Bug #10621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-19ruby.h: get rid of C++ warningsnobu
* include/ruby/ruby.h (PRIsVALUE): put a space after string literals not to be confused with C++11 string literal suffix. https://github.com/ruby/ruby/commit/a9f3eb7#commitcomment-9040169 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-11* class.c (class_alloc): Strat from age == 2.ko1
Class and Module objects can be living long life. * iseq.c: Same for ISeq objects. * gc.c (RVALUE_AGE_RESET): added. * gc.c (newobj_of): allow to generate (age != 0) objects. * gc.c (rb_copy_wb_protected_attribute): reset age for wb unprotected objects. * include/ruby/ruby.h: add RUBY_TYPED_PROMOTED1 as an unrecommended flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-03ruby.h: no warnings of hidden objectsnobu
* include/ruby/ruby.h (rb_data_object_alloc_warning): no warnings of internal hidden objects which klass == 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-29ruby.h: no parent in rb_data_type_tnobu
* error.c (rb_typeddata_is_kind_of, rb_check_typeddata): ditto. * error.c (rb_typeddata_inherited_p): deprecate. still keep for potential binary compatibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-26ruby.h: export keyword argument functionsnobu
* include/ruby/ruby.h (rb_get_kwargs, rb_extract_keywords): export keyword argument functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-16vm_eval.c: rb_current_receivernobu
* vm_eval.c (rb_current_receiver): new function to return the receiver in the current control frame. [Feature #10195] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-04ruby.h: add mark to PRIsVALUEnobu
* include/ruby/ruby.h (PRIsVALUE), vsnprintf.c (BSD_vfprintf): add RUBY_PRI_VALUE_MARK to reduce danger of accidental conflict with plain "%i". binary incompatible with extension libraries using PRIsVALUE and built for 2.1 and earlier. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-30ruby.h: optimize NUM2CHRnobu
* include/ruby/ruby.h (rb_num2char_inline): use RB_TYPE_P for optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-17* Avoid undefined behaviors found by gcc -fsanitize=undefined.akr
gcc (Debian 4.9.1-16) 4.9.1 * include/ruby/ruby.h (INT2FIX): Avoid undefined behavior. * node.h (nd_set_line): Ditto. * pack.c (encodes): Ditto. (pack_unpack): Ditto. * regint.h (BIT_STATUS_AT): Ditto. (BS_BIT): Ditto. * time.c (time_mdump): Ditto. (time_mload): Ditto. * vm_core.h (VM_FRAME_MAGIC_MASK): Ditto. * vm_trace.c (recalc_add_ruby_vm_event_flags): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-10ruby/ruby.h: fix for older gccnobu
* configure.in (__builtin_choose_expr_constant_p): in gcc 4.8 or earlier, __builtin_choose_expr() does not consider __builtin_constant_p(variable) a constant expression. * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): fix for older gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-10ruby/ruby.h: eliminate disabled function callnobu
* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): eliminate function call for warning/error if not match to get rid of unconditional warning/error by a certain compiler option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-01ruby.h: set rb_event_flag_t to uint32_tnormal
This ensures a consistent implementation between 32 and 64-bit platforms, as vm_trace.c limits events to 32-bits. This can also open up struct packing opportunities. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-28ruby.h: warn untyped Datanobu
* include/ruby/ruby.h (rb_data_object_alloc_warning): warn Data_Wrap_Struct and Data_Make_Struct only if RUBY_UNTYPED_DATA_WARNING is set to 1. * include/ruby/ruby.h (rb_data_object_get_warning): ditto for Data_Get_Struct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-27ruby.h: deprecate plain Datanobu
* include/ruby/ruby.h (rb_data_object_alloc_deprecated): deprecate Data_Make_Struct and Data_Wrap_Struct. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-19class.c: do not freeze class of hidden objectnobu
* class.c (rb_freeze_singleton_class): get rid of freeze class of hidden object to fix segfaults. * include/ruby/ruby.h (rb_obj_freeze_inline): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-19ruby.h: err rb_check_safe_str explicitlynobu
* include/ruby/ruby.h (rb_check_safe_str, Check_SafeStr): show error message to update for obsolete function and macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-19class.c: do not freeze meta-meta-classnobu
* class.c (rb_freeze_singleton_class): should not propagate to meta-meta-class, and so on, which is shared with the original class. fix occational exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-13class.c: freeze meta class onlynobu
* class.c (singleton_class_of): should not propagete freezing to meta meta class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-12ruby/ruby.h: freeze singleton classnobu
* include/ruby/ruby.h (rb_obj_freeze_inline): propagate freezing to the singleton class if it is existing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-12ruby/ruby.h: move commentsnobu
* include/ruby/ruby.h (enum ruby_special_consts): move bit pattern comments side-by-side. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-11* include/ruby/ruby.h, gc.c: add new internal eventsko1
RUBY_INTERNAL_EVENT_GC_ENTER and RUBY_INTERNAL_EVENT_GC_EXIT. When invoking GC process, GC_ENTER event is called. When exiting from GC process, GC_EXIT event is called. Incremental GC (incremental marking and lazy sweep) can call these events many times. For example (minor marking): (1) GC_ENTER - (2) GC_START (minor GC) (minor marking) - (3) GC_END_MARK (start lazy sweep) (4) GC_EXIT (ruby process) (5) GC_ENTER (lazy sweep) (6) GC_EXIT (ruby process) (... repeat (5), (6)) (7) GC_ENTER (finish lazy sweep) - (8) GC_END_SWEEP (9) GC_EXIT 2nd example (incremental major marking): (1) GC_ENTER - (2) GC_START (minor GC) (start incremental marking) (3) GC_EXIT (ruby process) (4) GC_ENTER (incremental marking) (5) GC_EXIT (ruby process) (... repeat (4), (5)) (6) GC_ENTER (finish incremental marking) - (7) GC_END_MARK (start lazy sweep) (8) GC_EXIT (ruby process) (9) GC_ENTER (lazy sweep) (10) GC_EXIT (ruby process) (... repeat (9), (10)) (11) GC_ENTER (finish lazy marking) - (12) GC_STOP_SWEEP (13) GC_EXIT Thease internal events enable to measure GC pause time completely. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e