summaryrefslogtreecommitdiff
path: root/gc.c
AgeCommit message (Collapse)Author
2012-01-27* gc.c (HEAP_ALIGN, HEAP_ALIGN_MASK): DRY, let compiler calculatenobu
from HEAP_ALIGN_LOG. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-17* gc.c (aligned_malloc, aligned_free): covered missing definednobu
operators and fixes for cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-11* gc.c (ruby_mimmalloc): don't set allocated size to header.nagachika
ruby_mimmalloc() doesn't increment allocated_size/allocations and decrement them in ruby_xfree() cause inconsistency. * gc.c (ruby_xfree): don't decrement allocated_size/allocations if allocated size record is 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10* gc.c (HEAP_OBJ_LIMIT): suppress narrowing down warning from gcc 4.2.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10* gc.c: in fact, i686-linux doesn't need to define _XOPEN_SOURCE 600.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10* gc.c (ruby_mimmalloc): defined for objects need not rb_objspace,naruse
but should return pointer suitable for ruby_xfree; main vm and main thread. patched by Sokolov Yura. https://github.com/ruby/ruby/pull/79 * internal.h: ditto. * vm.c (Init_BareVM): use ruby_mimmalloc. * ext/dl/cfunc.c: #include <ruby/util.h>. * ext/syslog/syslog.c: use xfree because it is allocated by ruby_strdup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09* gc.c (run_finalizer): clear rb_thread_t::errinfo when ignorenagachika
an exception under rb_protect(). [ruby-dev:45113] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09* gc.c : don't embed struct heaps_slot to a heap block because itnari
can causes copy-on-write of memory page on heap block when its free_next is rewirted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09* gc.c: free_slots is changed Singly linked list. clearnari
free_slots before sweep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-08* gc.c: i686-linux needs to define _XOPEN_SOURCE 600 for posix_memalign.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-08* gc.c (rb_objspace_free): global_List is allocated with xmalloc.naruse
patched by Sokolov Yura. https://github.com/ruby/ruby/pull/78 * dln_find.c: remove useless replacement of free. * ext/readline/readline.c (readline_attempted_completion_function): strings for readline must allocated with malloc. * process.c (run_exec_dup2): use free; see also r20950. * re.c (onig_new_with_source): use malloc for oniguruma. * vm.c (ruby_vm_destruct): use free for VMs. * vm.c (thread_free): use free for threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-08* gc.c : consider header bytes which are used by malloc.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-08* gc.c (aligned_free): support MinGW. Patch by Hiroshi Shirosaki.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-08* gc.c (slot_sweep): add a assertion instead of a debug print.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-07* gc.c: get rid of implicit narrowing conversion.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-07* configure.in: check posix_memalign(3) and menalign(3).naruse
* gc.c (aligned_malloc): use configure's result instead of _POSIX_C_SOURCE and _XOPEN_SOURCE because they can't be used to check availability at least on FreeBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-07* gc.c: use Bitmap Marking algorithm to avoid copy-on-write ofnari
memory pages. See [ruby-dev:45085] [Feature #5839] [ruby-core:41916]. * include/ruby/ruby.h : FL_MARK rename to FL_RESERVED1. * node.h : ditto. * debug.c : ditto. * object.c (rb_obj_clone): FL_MARK move to a bitmap. * class.c (rb_singleton_class_clone): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-26* node.h, node.c, parse.y: implement a parser part for keyword arguments. ↵mame
This is a preparation for keyword argument (see [ruby-core:40290]). * gc.c (gc_mark_children): bookkeeping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-26* node.h, parse.y (new_args_gen), compile.c (iseq_set_arguments): use struct ↵mame
rb_args_info instead of NODEs. This is a preparation for keyword argument (see [ruby-core:40290]). * node.c (dump_node), gc.c (gc_mark_children, obj_free): bookkeeping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05* bignum.c (big_rshift), compile.c (validate_label,nobu
iseq_build_from_ary_exception), cont.c (cont_capture), dir.c (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open) (rb_io_advise), parse.y (parser_compile_string) (rb_parser_compile_file), proc.c (binding_free), process.c (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core) (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null), signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main), vm_insnhelper.c (vm_expandarray): suppress unused-but-set-variable warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-28* gc.c (initial_params): static. it seems to be forgetten at r33501.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-21* gc.c (initial_params): pack in a struct.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-21* gc.c (rb_gc_set_params): set parameters always.nobu
[ruby-dev:44648] [Bug #5467] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-13* gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):nobu
should use ATOMIC_EXCHANGE() to check the previous value. [ruby-dev:44596] [Bug #5439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04* class.c (class_alloc): allocate extra memory after containingnobu
object setup to get rid of rare-but-potential memory leak. * gc.c (gc_mark_children): skip marking extended members if ptr is NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04* gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03* gc.c (rb_gc_set_params): output GC parameter change messages onlynagachika
if -w/-v options are specified. these messages are output to stderr, not to stdout. [ruby-core:39795] [Bug #5380] * test/ruby/test_gc.rb (test_gc_parameter): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-01* gc.c (add_heap_slots, init_heap): reset heaps_inc zero whennagachika
heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS. [ruby-core:39777] [Bug #5380] * test/ruby/test_gc.rb (test_gc_parameter): add test for it. * test/ruby/envutil.rb (assert_normal_exit): add :child_env option to enable pass environemnt variables to child process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* gc.c (slot_sweep, rb_gc_finalize_deferred)nobu
(rb_objspace_call_finalizer, rb_gc): run finalizers sequencially. [ruby-dev:44562] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* gc.c (is_id_value, is_live_object): extract from id2ref().nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* gc.c (run_finalizer): use object instead of object id.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* use RB_TYPE_P which is optimized for constant types, instead ofnobu
comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-25suppress warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-15* gc.c (mark_entry, mark_key, mark_keyvalue): adjust callbacknobu
argument types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09* gc.c (GC_PROFILE_MORE_DETAIL, CALC_EXACT_MALLOC_SIZE):ko1
define macros only if they are not defined. fixes: [Ruby 1.9 - Feature #5291] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-08* gc.c (Init_GC): defined GC::Profiler.raw_data. based on thenari
patch by Eric Hodel. [ruby-core:37857] [Bug #4991] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-08* gc.c (id2ref): objects which are unmarked but not in sweep_slotsnobu
are not dead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07* gc.c (id2ref): unmarked object is already dead while lazynobu
sweeping, and to it cannot come back since other objects referred from it might have been freed already. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03* variable.c (rb_const_set): show the previous definitionnobu
location. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-09* gc.c (gc_lazy_sweep): if sweep target slots are not found, wenari
try heap_increment() because it might be able to expand the heap. [Bug #5127] [ruby-dev:44285] * gc.c (gc_clear_mark_on_sweep_slots): if a sweeping was interrupted, we expand the heap if at all possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02Refix r32815.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02* gc.c (init_heap): allocate sigaltstack after heaps are allocated.naruse
[ruby-dev:44315] [Bug #5139] * vm.c (thread_free): use free because objspace is not ready. * vm.c (th_init): use malloc because objspace is not ready. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-25* proc.c (struct METHOD), gc.c (gc_marks), vm_method.cmame
(rb_gc_mark_unlinked_live_method_entries): fix SEGV bug. rb_method_entry_t was free'd even when the method is still on the stack if it is BMETHOD (i.e., Method#call). This is because rb_method_entry_t is embedded in struct METHOD. This commit separates them and marks the live method entries. See [ruby-core:38449] in detail. fix [Bug #5047] [ruby-core:38171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-08 * gc.c: Improve documentationdrbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-07* gc.c: change water_mark value value that may callnari
gc_mark(lev <= GC_LEVEL_MAX) in gc_mark(). In ruby_stack_check(), water_mark is a value that may call some C function. Fixes Bug #3781 * configure.in: define GC_MARK_STACKFRAME_WORD that approximate size of gc_mark() and gc_mark_children() stackframes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16* thread.c (rb_thread_schedule_rec): fix {UN,}LIKELY macro misuse.kosaki
* gc.c (rb_newobj): ditto. * vm_insnhelper.c (vm_method_search): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-15* gc.c: fix a regression by r31690 on AIX because AIX mallockosaki
return NULL if it's passed 0. But some caller don't expect it. patch by Yutaka Kanemoto. (vm_malloc_prepare): return calculated size. (vm_xmalloc): use above result. (vm_xcalloc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-14* gc.c (rb_gc_set_params): call initial_expand_heap ifnari
initial_heap_min_slots is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-14* gc.c: use size_t.nari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e