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

1219 Коммитов

Автор SHA1 Сообщение Дата
ko1 fce98c9e88 * gc.c (gc_writebarrier_generational): fix messages for rb_bug().
Remove `rb_' prefix.
* gc.c (gc_writebarrier_incremental): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-24 10:12:24 +00:00
ko1 30da8b833c * gc.c (obj_info): obj_info() can receive internal objects.
* gc.c (check_rvalue_consistency): obj_info() returns const char *.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-20 04:28:41 +00:00
ko1 1ab760bb51 revert r50031 because it includes unexpected patch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-20 04:27:45 +00:00
ko1 a38a1fbcc2 * gc.c (obj_info): obj_info() can receive internal objects.
* gc.c (check_rvalue_consistency): obj_info() returns const char *.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-20 03:41:10 +00:00
ko1 77205540e0 * gc.c (obj_info): show class name and T_DATA type_name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-20 03:17:06 +00:00
ko1 8ed4c1a420 * gc.c (rb_copy_wb_protected_attribute): `dest' can be WB unprotected.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19 13:13:46 +00:00
ko1 531f775fd4 * gc.c (rb_copy_wb_protected_attribute): demote `dest' object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19 12:26:49 +00:00
ko1 1643234fe3 * gc.c, internal.h: export rb_gc_verify_internal_consistency().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19 07:19:52 +00:00
ko1 9546ba4605 * gc.c (obj_info): show allocation site if GC_DEBUG is not 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19 07:16:27 +00:00
ko1 f537854ff3 * gc.c (newobj_of): fix RGENGC_OLD_NEWOBJ_CHECK logics.
* skip on incremental marking because not sure what happen :p
  * rb_gc_writebarrier_remember() is enough to mark children.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19 07:14:12 +00:00
ko1 38cfec906d * gc.c (rb_copy_wb_protected_attribute): need demote for old objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19 07:10:58 +00:00
ko1 05704f51fb * internal.h (IMEMO_DEBUG): added.
* internal.h: remove unused FL_IMEMO_MARK_V[0-3].
* gc.c (rb_imemo_new_debug): added.
* gc.c (obj_info): show imemo type name.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18 19:57:53 +00:00
ko1 33aaa89a79 * gc.c (RGENGC_OLD_NEWOBJ_CHECK): add check mechanism.
If RGENGC_OLD_NEWOBJ_CHECK > 0, then create old objects
  (not new objects) periodically.
  Create one old objects per RGENGC_OLD_NEWOBJ_CHECK objects are
  created.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18 19:54:14 +00:00
ko1 92fa998ce7 * gc.c (check_rvalue_consistency): refactoring.
* not inline on RGENGC_CHECK_MODE > 0.
  * check SPECIAL_CONST_P(obj) first.
  * add a check that remembered_bit is only TRUE when old (age == 3).
* gc.c (RVALUE_DEMOTE): should clear RVALUE_REMEMBERED bit.
  remembered_bit should be TRUE only for old (age == 3) objects.
  Actually there are no effect because demoted objects will be
  uncollectible WB unprotected objects (marked at the begginig of
  every minor GC).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18 18:46:10 +00:00
ko1 975c417957 * gc.c: rename terminologies.
* long_lived -> uncollectible:
    because this bitmap does not mean "long lived objects in past",
    but means "prohibit collection thse objects until next major GC".
    Uncollectible objects consist of two types objects, one is old
    objects (WB protected objects which age == 3) and another is
    uncollectible WB unprotected objects which are referred from old
    objects
  * remembered_wb_unprotected_objects ->
    uncollectible_wb_unprotected_objects:
    because uncollectible objects does not mean remembered objects.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18 18:02:13 +00:00
ko1 ec4624b0f4 * gc.c (gc_writebarrier_generational): add an alternative write
barrier (WB) implementation.
  When finding reference from [Old obj] to [New obj] by WB, current
  implementation marks [Old obj] as remembered old objects and marks
  chilldren of [Old obj] at the beggining of marking.
  Added (but disabled) code changes current behaviour. This fix promote
  [New obj] to old and marks as a remembered old object. We can assume
  "new objects referred from old objects are maybe long-lived old
  objects".
  Disadvantage of added algorithm is we may promote unwilling
  short-lived objects. For example, consider many new objects push and
  pop to an old stack object. All of new objects (short-lived objects)
  promote to old objects unexpectedly.
  To compare these behaviour, I add this new code (but disabled it).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18 09:02:10 +00:00
ko1 3b1e28036e * gc.c (RVALUE_PROMOTE_RAW): rename to RVALUE_OLD_LONG_LIVED_SET()
to make clear.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18 08:15:23 +00:00
ko1 3857777781 * gc.c (check_rvalue_consistency): do not need to check is_sweeping().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-18 08:12:44 +00:00
ko1 0db407836b * include/ruby/ruby.h: use rb_gc_writebrrier() simply.
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-17 10:26:39 +00:00
ko1 fea779829b * gc.c: RGENGC_CHECK_MODE should be 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11 23:15:35 +00:00
ko1 08f3cfb585 * internal.h: use T_IMEMO to represent `struct MEMO' value.
memo->v1 and memo->v2 is WB protected values.
  So use MEMO_V1/V2_SET() macros to set these values.
  memo->u3 is ambiguous (sometimes a VALUE, sometimes an integer
  value), so use gc_mark_maybe() in gc.c to mark it.
  Rename NEW_MEMO() to MEMO_NEW().
  Move MEMO_FOR and NEW_MEMO_FOF macros from node.h.
  Export a rb_imemo_new() function for ext/ripper.
* node.h: remove NODE_MEMO.
* enum.c: catch up these change.
* enumerator.c: ditto.
* load.c: ditto.
* ext/objspace/objspace.c (count_nodes): ditto.
* gc.c (gc_mark_children): mark imemo_memo type.
* parse.y (new_args_gen): use T_IMEMO.
  (I'm not sure it is working correctly...)



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11 23:13:01 +00:00
ko1 7790f37efd * node.h: remove NODE_IFUNC, NEW_IFUNC.
* internal.h: use T_IMEMO for IFUNC.
  rename `struct IFUNC' to `struct vm_ifunc' and move the definition
  from vm_insnhelper.h. Add imemo_ifunc.
* gc.c (gc_mark_children): mark imemo_ifunc type T_IMEMO object.
* compile.c: catch up these changes.
* proc.c: ditto.
* vm_core.h (RUBY_VM_IFUNC_P): ditto.
* vm_eval.c (rb_iterate): ditto.
* vm_insnhelper.c: ditto.
* ext/objspace/objspace.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11 13:31:11 +00:00
ko1 ce179b3d04 * vm_insnhelper.h: use T_IMEMO to create THROW_DATA.
Add THROW_DATA_NEW().
* internal.h: move defnition of `struct THROW_DATA'
  from vm_insnhelper.h to internal.h.
  Rename `THROW_DATA' to `vm_throw_data'.
* eval_intern.h (THROW_DATA_P): move to internal.h.
  THROW_DATA is no longer T_NODE, so check T_IMEMO.
* gc.c (gc_mark_children): mark THROW_DATA.
* vm.c: catch up these changes.
* vm_eval.c: ditto.
* vm_insnhelper.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11 12:49:27 +00:00
ko1 ac28b985bd * vm_insnhelper.c: use T_IMEMO to create SVAR.
* internal.h, vm_insnhelper.h: move definition `struct SVAR'
  from vm_insnhelper.h to internal.h. And rename it to strcut vm_svar.
  new imemo_type imemo_svar is added.
* gc.c (gc_mark_children): mark imemo_svar.
* node.c (rb_gc_mark_node): remove useless marking.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11 12:27:34 +00:00
ko1 0952b43b9b * include/ruby/ruby.h: introduce new type T_IMEMO.
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-11 10:36:17 +00:00
ko1 5922c95461 * gc.c: fix memory leak by prepend method.
It is easy to reproduce with such script:
    module M; def bar; end; end
    loop{
      Class.new do
        def foo; end
        prepend M
      end
    }
* gc.c (obj_free): free T_ICLASS::m_tbl if it is created by prepend.
  To recognize it, check RICLASS_IS_ORIGIN flag.
* gc.c (gc_mark_children): T_ICLASS objects only need to mark
  T_ICLASS::m_tbl if RICLASS_IS_ORIGIN is set.
* gc.c (obj_memsize_of): count T_ICLASS if RICLASS_IS_ORIGIN is set.
* internal.h (RCLASS_SET_ORIGIN): add to set RCLASS_SET_ORIGIN.
  TODO: The word `origin' seems not good name. We need to invent
  another good name.
* class.c: use RCLASS_SET_ORIGIN().
* class.c (class_alloc): zero clear rb_classext_t.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11 09:15:20 +00:00
ko1 d84f9b1694 * fix namespace issue on singleton class expressions. [Bug #10943]
* vm_core.h, method.h: remove rb_iseq_t::cref_stack. CREF is stored
  to rb_method_definition_t::body.iseq_body.cref.
* vm_insnhelper.c: modify SVAR usage.
  When calling ISEQ type method, push CREF information onto method
  frame, SVAR located place. Before this fix, SVAR is simply nil.
  After this patch, CREF (or NULL == Qfalse for not iseq methods)
  is stored at the method invocation.
  When SVAR is requierd, then put NODE_IF onto SVAR location,
  and NDOE_IF::nd_reserved points CREF itself.
* vm.c (vm_cref_new, vm_cref_dump, vm_cref_new_toplevel): added.
* vm_insnhelper.c (vm_push_frame): accept CREF.
* method.h, vm_method.c (rb_add_method_iseq): added. This function
  accepts iseq and CREF.
* class.c (clone_method): use rb_add_method_iseq().
* gc.c (mark_method_entry): mark method_entry::body.iseq_body.cref.
* iseq.c: remove CREF related codes.
* insns.def (getinlinecache/setinlinecache): CREF should be cache key
  because a different CREF has a different namespace.
* node.c (rb_gc_mark_node): mark NODE_IF::nd_reserved for SVAR.
* proc.c: catch up changes.
* struct.c: ditto.
* insns.def: ditto.
* vm_args.c (raise_argument_error): ditto.
* vm_eval.c: ditto.
* test/ruby/test_class.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-06 12:24:58 +00:00
ko1 01c6f50495 * gc.c (obj_info): show node name too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-05 22:34:10 +00:00
ko1 8f88ff4e37 * internal.h: remove struct method_table_wrapper.
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
2015-03-05 22:20:14 +00:00
nobu 9334597b11 gc.c: hide internal objects
* gc.c (id2ref): prohibit from accessing internal objects.
  [ruby-core:68348] [Bug #10918]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-01 02:18:00 +00:00
ko1 513fefdd1f * gc.c (rb_objspace_call_finalizer): control GC execution during
force firnalizations at the end of interpreter process.
  [Bug #10768]
  1) Prohibit incremental GC while running Ruby-level finalizers
     to avoid any danger.
  2) Prohibit GC while invoking T_DATA/T_FILE data structure
     because these operations break object relations consistency.
  This patch can introduce another memory consuming issue because
  Ruby-level finalizers can run after (2), GC is disabled.
  However, basically object consistency was broken at (2) as I
  described above. So that running Ruby-level finalizers contains
  danger originally. Because of this point, I need to suggest to
  remove these 3 lines (invoking remaining finalizers). And add a
  rule to add that finalizers should not add new finalizers, or
  say there is no guarantee to invoke finalizers that added by
  another finalizer.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-22 02:00:40 +00:00
nobu 670c01d90c gc.c: disable lazy sweeping check
* gc.c (rb_objspace_free): disable provisionally lazy sweeping
  check.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-08 15:16:24 +00:00
nobu f16b6fc5ab gc.c: disable gc_rest after finalization
* gc.c (rb_objspace_call_finalizer): disable provisionally gc_rest
  as it breaks RVALUE consistency.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-08 01:54:08 +00:00
tmm1 829fcdb2e8 gc.c: ensure GC state is consistent during VM shutdown
* gc.c (rb_objspace_free): cause rb_bug if lazy sweep is in progress
  during rb_objspace_free. Adds extra protection for r46340.
  Patch by Vicent Marti. [Bug #10768] [ruby-core:67734]
* gc.c (rb_objspace_call_finalizer): Ensure GC is completed after
  finalizers have run. We already call gc_rest() before invoking
  finalizers, but finalizer can allocate new objects and start new GC
  cycle, so we call gc_rest() again after finalizers are complete.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-02 20:58:32 +00:00
ngoto 7632a82d57 * gc.c (wmap_final_func): fix memory size shortage when realloc wmap.
Fix SEGV during finilize of WeakRef on Solaris (though the SEGV
  could occur on all OS/platforms). [ruby-dev:48779] [Bug #10646]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-25 08:33:41 +00:00
ko1 5d77730f69 * gc.c: remove unused rb_objspace_t::rgengc::old_objects_at_gc_start.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24 09:22:42 +00:00
normal 2c2bdb8b51 GC documentation update
* gc.c (GC_HEAP_FREE_SLOTS): move definition to match use order
  (RUBY_GC_HEAP_GROWTH_SLOTS): s/factor/number of slots/

* man/ruby.1: add section for GC environment variables
  [Feature #10197]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-15 22:39:33 +00:00
ko1 85b42fe17b * ext/objspace/objspace.c: ObjectSpace.memsize_of(obj) returns
with sizeof(RVALUE). [Bug #8984]
* gc.c (obj_memsize_of): ditto.
* NEWS: add a NEWS entry.
* test/objspace/test_objspace.rb: catch up this fix.
* test/ruby/test_file_exhaustive.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-15 08:54:07 +00:00
normal 856903850b gc.c (define_final0): avoid duplicate blocks
This prevents excessive memory growth when a WeakRef
is repeatedly created

* gc.c (define_final0): avoid duplicate blocks
  [Bug #10537]
* test/test_weakref.rb (test_repeated_object_leak): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-13 01:28:18 +00:00
ko1 37b6f50ae5 * gc.c (gc_latest_gc_info): return :state field to show current
GC state (none/marking/sweeping).
  [Feature #10590]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-12 04:09:28 +00:00
ko1 1b6aa03eb9 * class.c (class_alloc): Strat from age == 2.
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-11 10:15:30 +00:00
nobu e580a631be use 0 for reserved
use 0 for rb_data_type_t::reserved instead of NULL, since its type
may be changed in the future and possibly not a pointer type.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01 06:38:04 +00:00
ko1 3a26241da3 * gc.c (objspace_malloc_increase): enable lazy sweep on GC by malloc()
(malloc_increase) to make GC incrementally.
  This change can increase memory consumption. Report us if you find
  any problem.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-27 04:20:14 +00:00
nobu 606e855622 rb_id2str over rb_id2name
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-25 18:44:22 +00:00
ko1 43a5972a3e * gc.c (gc_record): add information for debug print.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18 22:17:54 +00:00
akr 2b9191e557 * internal.h: Gather declarations in non-header files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18 15:13:05 +00:00
akr 7cd76ab0c5 * internal.h: Include ruby.h and ruby/encoding.h to be
includable without prior inclusion.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:49:06 +00:00
nobu 7a699d8b0b gc.c: check arguments
* gc.c (default_proc_for_compat_func): check arguments number and
  type, and get rid of reentering this default proc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-14 07:59:55 +00:00
ko1 a84b2a6afd * gc.c (gc_stat_internal): support comatible layer for
GC.stat(symbol) type acess.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-14 07:35:05 +00:00
ko1 5d5c95f28e * gc.c (gc_stat_internal): add compatible layer.
From Ruby 2.2, keys of GC.stat are changed [Feature #9924].
  To provide compatible layer, GC.stat add a default_proc
  (if default_proc of given Hash object is not set).
  At first use of this compatible layer of interpreter process,
  show a warning message like that:
  program: GC.stat[:total_allocated_object]
  warning message: "warning: GC.stat keys were changed from Ruby
  2.1. In this case,  you refer to obsolete `total_allocated_object'
  (new key is `total_allocated_objects').
  Please check <https://bugs.ruby-lang.org/issues/9924>
  for more information."
  Pleaes correct my English message :)
* hash.c (rb_hash_set_default_proc): export (in internal).
* internal.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-14 07:29:33 +00:00