summaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* * removed spaces just before tabs.nobu2009-11-261-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_mod_init_copy): fix memory leak of Class#dup.mame2009-11-141-3/+3
| | | | | | [ruby-dev:39687] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (vm_xrealloc): use the given object space.nobu2009-11-131-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (GET_STACK_BOUNDS): refactored common code. based on anobu2009-10-311-28/+15
| | | | | | | | patch from Suraj N. Kurapati <sunaku AT gmail.com> in [ruby-core:26443]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (garbage_collect_with_gvl): do not garbage_collect whenmatz2009-10-261-0/+1
| | | | | | dont_gc flag turned on. [ruby-core:26327] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (warnflags): use -Wextra instead of -Wall.nobu2009-10-221-3/+4
| | | | | | | * gc.c (mark_current_machine_context): get rid of warning. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu2009-09-211-1/+1
| | | | | | | | | thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c, vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl, tool/instruction.rb: fixed types. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (eval.o): needs vm.h.nobu2009-09-181-1/+35
| | | | | | | | | | | * eval.c (ruby_cleanup): destruct current VM before exit. * gc.c (rb_objspace_free): free object space. * vm.c (ruby_vm_destruct): destruct and free VM struct. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (vm_xrealloc): free as like standard free if size is zero.nobu2009-09-171-1/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (obj_free): fix to free method table (fix memory leak).ko12009-09-021-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h (rb_method_definition_t): split from rb_method_entry_tnobu2009-08-281-4/+7
| | | | | | | | | to deal aliases. [ruby-dev:39165] * proc.c (struct METHOD): contains rb_method_entry_t copy. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.c (rb_method_entry_t): body.proc should be marked.nobu2009-08-261-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: reject unused longlife gc.nari2009-08-101-242/+19
| | | | | | | | | | | | | | | | | | | | * debug.c: ditto. * include/ruby/intern.h: ditto. * include/ruby/ruby.h: ditto. * iseq.c: ditto. * node.h: ditto. * vm_insnhelper.c: ditto. * vm_insnhelper.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_enable, rb_gc_disable): should return Qtrue/Qfalse.nobu2009-07-211-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-16/+16
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko12009-07-151-12/+60
| | | | | | | | | | | | | | | | | | | | | method management. This change affect some VM control stack structure. * vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto. and make some refactoring. * insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto. * vm_core.h, compile.c (iseq_specialized_instruction): remove VM_CALL_SEND_BIT. use another optimization tech for Kernel#send. * node.h: remove unused node types. * ext/objspace/objspace.c (count_nodes): ditto. * gc.c: add mark/free functions for method entry. * include/ruby/intern.h: remove decl of rb_define_notimplement_method_id(). nobody can use it because noex is not opend. * iseq.c (iseq_mark): fix to check ic_method is available. * iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h:ko12009-07-071-1/+1
| | | | | | | | | | | | | | rename "...TypeStruct" and "typed_struct" to "TypedData..." and "typeddata", respectively. rename rb_data_type_t#name to rb_data_type_t#wrap_struct_name. * error.c, gc.c, iseq.c, vm.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_call_finalizer_at_exit): deal with typed struct likenobu2009-07-071-0/+3
| | | | | | | as obj_free(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (GC_PROF_SET_MALLOC_INFO, GC_PROF_SET_HEAP_INFO): simplified.nobu2009-07-071-16/+16
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: remove the definition of GC_DEBUG (debugging macro).mame2009-06-231-3/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix indent.ko12009-06-161-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: New structure RTypedData, added.ko12009-06-161-2/+56
| | | | | | | | | | | | | | | | | | | This structure incldues more explicit type information for T_DATA objects. If RData(obj)->dfree is immediate value `1' on T_DATA object obj, obj is needed to be accessed with RTYPEDDATA(obj) instead of RDATA(obj). A RTypedData structure points the structure rb_typed_data_t. rb_typed_data_t includes information such as the type name of this data, mark and free function what RData includes, and memsize function show how data consuming the memory size. Note that you do not need any change existing T_DATA objects. If you use RDataType instead of RData on T_DATA object, you can specify explicit type information. * gc.c (rb_data_typed_object_alloc, rb_objspace_data_type_memsize, rb_objspace_data_type_name): added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: fix indent.ko12009-06-161-21/+21
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_each_objects): New C API, added.ko12009-06-161-12/+90
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (os_obj_of): invoke garbage collection before iteration, tomatz2009-06-151-1/+3
| | | | | | avoid accessing half recycled object references. [ruby-dev:38613] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: fixed types.nobu2009-05-261-6/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: add longlife garbage collection. [ruby-dev:38423]nari2009-05-131-24/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (NORMAL_HEAPS_USED): new macro. (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto. (add_longlife_heaps_slot): new function. (rb_newobj_from_longlife_heap): ditto. (rb_newobj_longlife): ditto. (rb_node_newnode_longlife): ditto. (rb_gc_write_barrier): ditto. (remembered_set_recycle): ditto. (rb_gc_mark_remembered_set): ditto. (clear_mark_longlife_heaps): ditto. (gc_sweep_for_longlife): ditto. (assign_heap_slot): new argumnent to longlife heaps slot. (add_freelist): ditto. (gc_sweep): avoid lonlife heap slot. set longlife_collection flag at add heap. (rb_gc_force_recycle): avoid mark object and remembered_set object. (garbage_collect): add longlife collection. (rb_gc_start): invoke longlife collection. (gc_profile_record_get): for longlife collction profile. (gc_profile_result): ditto. * include/ruby/intern.h (rb_gc_write_barrier): declared. * include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED. * debug.c (FL_REMEMBERED_SET): ditto. * insns.def (setinlinecache): insert write barrier. * vm_insnhelper.c (vm_method_search): ditto. * set_relation (set_relation): use longlife object. * vm.c (vm_define_method): ditto. * vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto. * vm_method.c (rb_add_method): ditto. * class.c (rb_add_method): ditto. * node.h (NEW_NODE_LONGLIFE): new macro. (rb_node_newnode_longlife): declared. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): the order of local variables on stack isnobu2009-04-191-3/+3
| | | | | | | | | | | | undefined. should use outermost VALUE for ruby_init_stack. * gc.c (ruby_get_stack_grow_direction, Init_stack): allows volatile pointer. * thread_*.c (ruby_init_stack): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (init_heap): set default to heap slots lengthnari2009-03-231-0/+9
| | | | | | | | | if HEAP_OBJ_LIMIT is larger than HEAP_MIN_SLOTS. [Bug #1310] (set_heaps_increment): increment next_heaps_length if next_heaps_length and heaps_used are same. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (AC_HEADER_DIRENT): added.nobu2009-03-131-5/+5
| | | | | | | | | | | | * include/ruby/ruby.h (NUM2INT, rb_special_const_p): returns true and false instead of Qtrue and Qfalse for platforms where VALUE is bigger than int. * gc.c (gc_stress_set), ext/openssl/ossl_asn1.c (decode_bool): got rid of variables named `bool'. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,nobu2009-03-121-4/+4
| | | | | | | | | | numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, gc.c, numeric.c, string.c, util.c, insns.def,nobu2009-03-101-4/+4
| | | | | | | missing/crypt.c, missing/vsnprintf.c, : suppress warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_get_stack_grow_direction): no needs to use threadnobu2009-02-271-3/+3
| | | | | | | here, and not initialized yet. [ruby-core:22439] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-8/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),mame2009-02-141-1/+0
| | | | | | | | | | | | include/ruby/intern.h: add Murmurhash API. [ruby-dev:37784] * complex.c (nucomp_hash), array.c (rb_ary_hash), time.c (time_hash), string.c (rb_str_hsah), object.c (rb_obj_hash), range.c (range_hash), struct.c (rb_struct_hash), hash.c (rb_any_hash), rational.c (nurat_hash): use Murmurhash. [ruby-dev:37784] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (vm_xmalloc, vm_xrealloc): comparisons had no meanings onnobu2009-02-121-2/+2
| | | | | | | platforms where size_t is unsigned. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (define_final, undefine_final): shouldn't add/remove finalizerusa2009-02-111-0/+3
| | | | | | | | | | | of forzen objects. * gc.c (undefine_final): should remove FL_FINALIZE flag. [ruby-dev:37964] (also see [ruby-dev:37959]) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (define_final): cannot define finalizer for immediatenobu2009-01-221-2/+9
| | | | | | | | | values. [ruby-core:21500] * gc.c (define_final): freezes or hides internal values. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (garbage_collect_with_gvl): suppress warnings.ko12009-01-191-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_with_gvl): suppress warnings.ko12009-01-151-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (negative_size_allocation_error_with_gvl): abolish a warning.akr2009-01-141-2/+2
| | | | | | | | | | (negative_size_allocation_error): ditto. * ext/openssl/ossl.c (ossl_raise): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_xmalloc, ruby_xrealloc, ruby_xfree):ko12009-01-121-8/+82
| | | | | | | | | | enable to use them without GVL. if GC is invoked, acquire GVL during GC. if NoMemoryError is raised, acquire GVL and raise it. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each), gc.c (assign_heap_slot),nobu2008-12-091-2/+2
| | | | | | | | | | | | | (gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add), proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all), (thread_start_func_2, blocking_region_begin, blocking_region_end), (rb_thread_kill), thread_pthread.c (native_thread_create), (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state), (vm_call0): use void pointer for %p. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark): still needs to check stack depth during GC.matz2008-11-271-6/+12
| | | | | | * gc.c (stack_check): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_stack_check): no check if using sigaltstack.nobu2008-11-271-0/+4
| | | | | | | | | | | | | | | | * signal.c (register_sigaltstack): minimum size is insufficient for method calls. * signal.c (sigsegv): handles stack overflow if possible. * thread.c (ruby_thread_stack_overflow): helper function to raise sysstack_error. * thread_pthread.c (ruby_stack_overflowed_p): checks for stack overflow. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): added write_lock to serialize.nobu2008-11-071-1/+3
| | | | | | | | | | | | | | [ruby-core:19668] * gc.c (gc_mark_children): mark write_lock. * gc.c (rb_gc_call_finalizer_at_exit): Mutex also needs to be deferred. * io.c (io_fflush, io_binwrite, fptr_finalize): serializes writing. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_profile_result): bug fix. The millisecond is 1/1000.nari2008-10-251-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: embeds the elements of an array into itsyugui2008-10-091-1/+1
| | | | | | | | | | | | | | | | | | struct RArray for # of elements <= 3. * array.c: ditto. * gc.c (gc_mark_children): following the change of struct RArray. * ext/tk/tcltklib.c (ip_ruby_cmp): ditto. * parse.y (coverage): ditto. * proc.c (curry): ditto. * .gdbinit: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark_children): ignores T_ZOMBIE.nobu2008-10-061-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e