summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2013-11-29vm_eval.c: rb_yield_blocknobu
* vm_eval.c (rb_yield_block): yield block with rb_block_call_func arguments. * range.c (range_each): use rb_yield_block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h, enum.c, vm_eval.c: constify argvnobu
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): constify argv. * enum.c (rb_enum_values_pack): ditto. * vm_eval.c (rb_block_call, rb_check_block_call): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h: RB_BLOCK_CALL_FUNC_ARGLISTnobu
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration argument list of rb_block_call_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h: rb_block_call_func_tnobu
* include/ruby/ruby.h (rb_block_call_func_t): strict check for rb_block_call_func* if RB_BLOCK_CALL_FUNC_STRICT is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29ruby/ruby.h: add blockarg to rb_block_call_funcnobu
* include/ruby/ruby.h (rb_block_call_func): add blockarg. block function can take block argument, e.g., proc {|&blockarg| ...}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-28* st.c: add st_values() and st_values_check().glass
* include/ruby/st.h: add prototypes for above. * hash.c (rb_hash_values): use st_values_check() for performance improvement if VALUE and st_data_t are compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-28* st.c (st_keys): fix not to use Qundef in st.c.glass
* include/ruby/st.h: define modified prototype. * hash.c (rb_hash_keys): use modified st_keys(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-28win32.c: rb_w32_dup2nobu
* win32/win32.c (rb_w32_dup2): extract from rb_cloexec_dup2() and redirect_dup2(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* st.c (st_keys): define st_keys(). it writes each key to buffer.glass
* hash.c (rb_hash_keys): use st_keys() for performance improvement if st_data_t and VALUE are compatible. * st.h: define macro ST_DATA_COMPATIBLE_P() to predicate whether st_data_t and passed type are compatible. * configure.in: check existence of builtin function to use in ST_DATA_COMPATIBLE_P(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-24* include/ruby/defines.h (SIZEOF_ACTUAL_BDIGIT): Defined.akr
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Use SIZEOF_ACTUAL_BDIGIT instead of SIZEOF_BDIGITS. SIZEOF_BDIGITS can be different to sizeof(BDIGIT). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-24* include/ruby/defines.h: Don't use int128_t for Bignum.akr
It's not always faster. * bignum.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23ruby.h: define RBIGNUM_EMBED_LEN_MAX by macrosnobu
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros defined in defines.h, instead of complex and repeated expression. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Limit the value toakr
less than 8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* include/ruby/intern.h, internal.h: Expose rb_gc_count().nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* include/ruby/intern.h (rb_gc_set_params): Deprecatenari
rb_gc_set_params because it's only used in ruby internal. * internal.h (ruby_gc_set_params): Declare rb_gc_set_params's alias function. * gc.c: ditto. * ruby.c: use ruby_gc_set_params. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09gc.c: finalizer functionsnobu
* gc.c (rb_define_finalizer, rb_undefine_finalizer): rename and export finalizer functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-04* gc.c: add 3gen GC patch, but disabled as default.ko1
RGenGC is designed as 2 generational GC, young and old generation. Young objects will be promoted to old objects after one GC. Old objects are not collect until major (full) GC. The issue of this approach is some objects can promoted as old objects accidentally and not freed until major GC. Major GC is not frequently so short-lived but accidentally becoming old objects are not freed. For example, the program "loop{Array.new(1_000_000)}" consumes huge memories because short lived objects (an array which has 1M elements) are promoted while GC and they are not freed before major GC. To solve this problem, generational GC with more generations technique is known. This patch implements three generations gen GC. At first, newly created objects are "Infant" objects. After surviving one GC, "Infant" objects are promoted to "Young" objects. "Young" objects are promoted to "Old" objects after surviving next GC. "Infant" and "Young" objects are collected if it is not marked while minor GC. So that this technique solves this problem. Representation of generations: * Infant: !FL_PROMOTED and !oldgen_bitmap [00] * Young : FL_PROMOTED and !oldgen_bitmap [10] * Old : FL_PROMOTED and oldgen_bitmap [11] The macro "RGENGC_THREEGEN" enables/disables this feature, and turned off as default because there are several problems. (1) Failed sometimes (Heisenbugs). (2) Performance down. Especially on write barriers. We need to detect Young or Old object by oldgen_bitmap. It is slower than checking flags. To evaluate this feature on more applications, I commit this patch. Reports are very welcome. This patch includes some refactoring (renaming names, etc). * include/ruby/ruby.h: catch up 3gen GC. * .gdbinit: fix to show a prompt "[PROMOTED]" for promoted objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-04* include/ruby/ruby.h: rename FL_OLDGEN to FL_PROMOTED.ko1
This flag represents that "this object is promoted at least once." * gc.c, debug.c, object.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-01string.c: export rb_str_scrubnobu
* string.c (rb_str_scrub): export with fixed length arguments, and allow nil as replacement string instead of omitting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* include/ruby/ruby.h: fix typo (FL_WB_PROTECT -> FL_WB_PROTECTED).ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* include/ruby/ruby.h: introduce new flags for T_TYPEDDATA.ko1
* RUBY_TYPED_FREE_IMMEDIATELY: free the data given by DATA_PTR() with dfree function immediately. Otherwise (default), the data freed at finalizaton point. * RUBY_TYPED_WB_PROTECTED: make this object with FL_WB_PROTECT (not shady). * gc.c (obj_free): support RUBY_TYPED_FREE_IMMEDIATELY. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: splitcharliesome
ruby_vm_global_state_version into two separate counters - one for the global method state and one for the global constant state. This means changes to constants do not affect method caches, and changes to methods do not affect constant caches. In particular, this means inclusions of modules containing constants no longer globally invalidate the method cache. * class.c, eval.c, include/ruby/intern.h, insns.def, vm.c, vm_method.c: rename rb_clear_cache_by_class to rb_clear_method_cache_by_class * class.c, include/ruby/intern.h, variable.c, vm_method.c: add rb_clear_constant_cache * compile.c, vm_core.h, vm_insnhelper.c: rename vmstat field in rb_call_info_struct to method_state * vm_method.c: rename vmstat field in struct cache_entry to method_state git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-23win32.h: suppress INFINITY warningsnobu
* include/ruby/win32.h (rb_infinity_float): suppress overflow in constant arithmetic warnings. [ruby-core:57981] [Bug #9044] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20ruby.h: suppress warningsnobu
* include/ruby/ruby.h (rb_obj_wb_unprotect, rb_obj_written), (rb_obj_write): suppress unused-parameter warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-14win32.h: declare fstati64 to suppress warningsnobu
* include/ruby/win32.h (fstati64): declare for ext/-test-/file/stat.c on w64-mingw, to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-13* vsnprintf.c: Fix spelling from compliment to complement.charliesome
Patch by @agrimm. Closes GH-422. * include/ruby/ruby.h: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-10win32.h: define or declare finite alwaysnobu
* include/ruby/win32.h (finite): always define or declare. some mingw (maybe w64 only?) lack the declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-10st.c: revert st_keysnobu
* st.c: revert st_keys() at r43238. VALUE cannot be in st.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-10* st.c (st_keys): define st_keys() for performance improvement ofglass
Hash#keys and Array#uniq. * st.h: ditto. * hash.c (rb_hash_keys): use st_keys(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09compar.c: fail if recursionnobu
* compar.c (cmp_eq): fail if recursion. [ruby-core:57736] [Bug #9003] * thread.c (rb_exec_recursive_paired_outer): new function which is combinnation of paired and outer variants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09* include/ruby/debug.h,ko1
vm_backtrace.c (rb_profile_frame_full_label): add new C API rb_profile_frame_full_label() which returns label with qualified method name. Note that in future version of Ruby label() may return same return value of full_label(). * ext/-test-/debug/profile_frames.c, test/-ext-/debug/test_profile_frames.rb: fix a test for this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-08* vm_backtrace.c, include/ruby/debug.h: add new APIsko1
* VALUE rb_profile_frame_method_name(VALUE frame) * VALUE rb_profile_frame_qualified_method_name(VALUE frame) * iseq.c (rb_iseq_klass), internal.h: add new internal function rb_iseq_method_name(). * ext/-test-/debug/profile_frames.c (profile_frames), test/-ext-/debug/test_profile_frames.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07* include/ruby/debug.h: add backtrace collecting APIs for profiler.ko1
* int rb_profile_frames(int start, int limit, VALUE *buff, int *lines); Collect information of frame information. * VALUE rb_profile_frame_path(VALUE frame); * VALUE rb_profile_frame_absolute_path(VALUE frame); * VALUE rb_profile_frame_label(VALUE frame); * VALUE rb_profile_frame_base_label(VALUE frame); * VALUE rb_profile_frame_first_lineno(VALUE frame); * VALUE rb_profile_frame_classpath(VALUE frame); * VALUE rb_profile_frame_singleton_method_p(VALUE frame); Get information about each frame. These APIs are designed for profilers, for example, no objectallocation, and enough information for profilers. In this version, this API collects only collect Ruby level frames. This issue will be fixed after Ruby 2.1. * vm_backtrace.c: implement above APIs. * iseq.c (rb_iseq_klass): return local_iseq's class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-01file.c: export rb_stat_newnobu
* file.c (stat_new_0): constify. * file.c (rb_stat_new): constify and export. based on a patch by Hanmac (Hans Mackowiak) at [ruby-core:53225]. [Feature #8050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-01ruby.h: export ruby_safe_level_4_warningnobu
* include/ruby/ruby.h (ruby_safe_level_4_warning): needed by extension libraries which check safe level 4. [ruby-dev:47517] [Bug #8652] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-25* include/ruby/ruby.h: rename RARRAY_RAWPTR() to RARRAY_CONST_PTR().ko1
RARRAY_RAWPTR(ary) returns (const VALUE *) type pointer and usecase of this macro is not acquire raw pointer, but acquire read-only pointer. So we rename to better name. RSTRUCT_RAWPTR() is also renamed to RSTRUCT_CONST_PTR() (I expect that nobody use it). * array.c, compile.c, cont.c, enumerator.c, gc.c, proc.c, random.c, string.c, struct.c, thread.c, vm_eval.c, vm_insnhelper.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-25internal.h: move inline functionsnobu
* internal.h (rb_float_value, rb_float_new): move inline functions from ruby/ruby.h. * numeric.c (rb_float_value, rb_float_new): define external functions for extension libraries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-22intern.h: move rb_ary_cat from internal.hnobu
* include/ruby/intern.h (rb_ary_cat): move from internal.h, since it is described in README.EXT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-19* include/ruby/ruby.h: make Symbol objects frozen.ko1
[Feature #8906] I want to freeze this good day, too. * test/ruby/test_eval.rb: catch up this change. * test/ruby/test_symbol.rb: add a test to check frozen symbols. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-06* common.mk: use RUNRUBY instead of MINIRUBY because MINIRUBY can'tglass
require extension libraries. The patch is from nobu (Nobuyoshi Nakada). * ext/thread/extconf.rb: for build ext/thread/thread.c. * include/ruby/intern.h: ditto. * thread.c: ditto. * lib/thread.rb: removed and replaced by ext/thread/thread.c. * ext/thread/thread.c: Queue, SizedQueue and ConditionVariable implementations in C. This patch is based on patches from panaggio (Ricardo Panaggio) and funny_falcon (Yura Sokolov) and ko1 (Koichi Sasada). [ruby-core:31513] [Feature #3620] * test/thread/test_queue.rb (test_queue_thread_raise): add a test for ensuring that killed thread should be removed from waiting threads. It is based on a code by ko1 (Koichi Sasada). [ruby-core:45950] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-06win32.c: clock_getresnobu
* win32/win32.c (clock_getres): required as well as clock_gettime(). [ruby-dev:47699] [Bug #8869] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-06transcode.c: add rb_econv_appendnobu
* transcode.c (rb_econv_append): new function to append a string data with converting its encoding. split from rb_econv_substr_append. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-05* include/ruby/ruby.h: add RSTRING_FSTR flagcharliesome
* internal.h: add rb_fstring() prototype * parse.y (str_suffix_gen): deduplicate frozen string literals * string.c (rb_fstring): deduplicate frozen string literals * string.c (rb_str_free): delete fstrings from frozen_strings table when they are GC'd * string.c (Init_String): initialize frozen_strings table * test/ruby/test_string.rb: test frozen strings are deduplicated git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03string.c: rb_enc_str_new_cstrnobu
* string.c (rb_enc_str_new_cstr): new function to create a string from the C-string pointer with the specified encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-30encoding.h: fix conflictsnobu
* include/ruby/encoding.h (rb_{ascii8bit,utf8,usascii}_encindex): get rid of conflict with macros defined in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-29* struct.c (rb_struct_define_without_accessor_under): added.ko1
This function is similar to rb_define_class_under() against rb_define_class(). * include/ruby/intern.h: add a declaration of this function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-27vm_eval.c: constifynobu
* vm_eval.c (rb_check_funcall, rb_check_funcall_with_hook): constify argv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-19* include/ruby/defines.h: Fix a compilation error withakr
i586-mingw32msvc-gcc of gcc-mingw32 package on Debian squeeze. ruby/missing.h should be included before include/ruby/win32.h because struct timespec, used in the clock_gettime declaration in include/ruby/win32.h, is defined in ruby/missing.h instead of system headers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-19* include/ruby/win32.h (CLOCK_MONOTONIC): typo.usa
* win32/win32.c: removed duplicated declarations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-15* include/ruby/win32.h, win32/Makefile.sub, win32/win32.cusa
(clock_gettime): [experimental] emulates clock_gettime(2) of posix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e