aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* rb_thread_call_without_gvlnobu2012-07-101-0/+1
| | | | | | | | | * include/ruby/thread.h: new header file for thread stuff. * thread.c (rb_thread_call_without_gvl): export. [Feature#4328] returns void* instead of VALUE. [Feature #5543] * thread.c (rb_thread_blocking_region): deprecate. [ruby-core:46295] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c, atomic.h (ATOMIC_SIZE_*): moved from gc.c to atomic.h [ruby-dev:45909]ngoto2012-07-041-50/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ATOMIC_SIZE_*): 64bit Windows support.usa2012-07-041-5/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ATOMIC_SIZE_EXCHANGE): fix function name on Solaris [Bug #6689]ngoto2012-07-031-1/+1
| | | | | | | [ruby-dev:45904] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: atomic operations for malloc_paramsnobu2012-07-031-10/+53
| | | | | | | * gc.c (vm_malloc_fixup, vm_xrealloc, vm_xfree, after_gc_sweep): use atomic operations to update malloc_params. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix allocated_sizenobu2012-07-031-2/+5
| | | | | | | * gc.c (vm_xrealloc): fix allocated_size update, should not ignore old size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: simplifiednobu2012-06-021-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* adjust indentnobu2012-05-311-1/+1
| | | | | | * gc.c (os_obj_of_i): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (obj_free): doesn't free a method table if it doesn'tnari2012-05-281-1/+3
| | | | | | | | exits. [ruby-dev:44436] * test/ruby/test_gc.rb (class TestGc): added the test case for this issue. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Imports Ruby's port to NativeClient (a.k.a NaCl).yugui2012-05-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Google Inc. [ruby-core:45073]. * configure.in (RUBY_NACL): New M4 func to configure variables for NaCl. (RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names of Pepper interface types. (BTESTRUBY): New variable to specify which ruby should be run on "make btest". NaCl can run the built binary by sel_ldr, but it need rbconfig.rb. So this variable is distinguished from $MINIRUBY. * thread_pthread.c: Disabled some features on NaCl. * io.c: ditto. * process.c: ditto. * signal.c: ditto. * file.c: ditto. * missing/flock.c: ditto. * nacl/pepper_main.c: An example implementation of Pepper application that embeds Ruby. * nacl/example.html: An example of web page that uses the Pepper application. * nacl/nacl-config.rb: Detects variants of NaCl SDK. * nacl/GNUmakefile.in: Makefile template for NaCl specific build process. * nacl/package.rb: script for packaging a NaCl-Ruby embedding application. * nacl/reate_nmf.rb: Wrapper script of create_nmf.py * dln.c (dln_load): Added a hack to call on NaCl. * util.c (ruby_getcwd): Path to the current directort is not available on NaCl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (obj_free): show entire flags too.nobu2012-04-131-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (GET_HEAP_HEADER, NUM_IN_SLOT): parenthesise macro parameters.nobu2012-04-121-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): pass pointer to key to the callback function.nobu2012-03-291-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): add existing parameter to the callback function.nobu2012-03-291-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix condition for freenobu2012-03-181-2/+3
| | | | | | | * gc.c (aligned_free): fix condition for free. memalign() and posix_memalign() are not defined together normally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (aligned_malloc, aligned_free): added fallback implementationsyugui2012-03-181-2/+15
| | | | | | for platforms like OSX Leopard. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (free_method_entry_i): method entry may be innobu2012-03-181-1/+3
| | | | | | | unlinked_method_entry_list. [ruby-core:43383][Bug #6171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Bug #5350nobu2012-03-131-8/+209
| | | | | | | * gc.c: add ObjectSpace::WeakMap. [ruby-dev:44565][Bug #5350] * lib/weakref.rb: use WeakMap instead of _id2ref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c : remove gc_clear_mark_on_sweep_slots() and usenari2012-02-211-21/+5
| | | | | | | | rest_sweep() instead of it, because some dead objects might be marked in next the mark phase by false pointers. [ruby-core:42672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r34691 and r34689nari2012-02-191-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_clear_mark_on_sweep_slots): remove a unused variable.nari2012-02-191-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_clear_mark_on_sweep_slots): uses slot_sweep() fornari2012-02-191-2/+1
| | | | | | | unsweeped slots, because some dead objects might be marked in next the mark phase by false pointers. [ruby-core:42672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (rb_fiber_reset_root_local_storage): add a new function tonagachika2012-02-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | restore rb_thread_t::local_storage. * cont.c (rb_obj_is_fiber): add a new function to tell finalizer to prevent fibers from destroy. * gc.c (rb_objspace_call_finalizer): don't sweep fibers at finalizing objspace. * internal.h (rb_fiber_reset_root_local_storage, rb_obj_is_fiber): add prototypes. * vm.c (ruby_vm_destruct): reset main thread's local_storage before free main thread. rb_thread_t::local_storage is replaced by fiber's local storage when forked from fiber, and it should be already freed when the fiber was destroyed. * test/ruby/test_fiber.rb (test_fork_from_fiber): add test for fork from fiber. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (HEAP_BITMAP_LIMIT): HEAP_BITMAP_LIMIT is computed on thenari2012-02-151-1/+1
| | | | | | | basis of HEAP_SIZE because it must covers a whole heap block. [ruby-trunk - Bug #6006] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (CEILDIV): rename to a appropriate name.nari2012-02-141-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (assign_heap_slot): SEGV happens cause on 64-bit platformnari2012-02-141-3/+1
| | | | | | | sometime there should be `objs-=2` instead of `objs--`. patched by Sokolov Yura. https://github.com/ruby/ruby/pull/92 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (HEAP_OBJ_LIMIT, HEAP_BITMAP_LIMIT): HEAP_OBJ_LIMIT usednari2012-02-131-2/+3
| | | | | | | | | | | `sizeof(struct heaps_slot)` while heap is currently allocated with `struct heaps_header`. HEAP_BITMAP_LIMIT were calculated from `HEAP_OBJ_LIMIT/sizeof(uintptr_t)` - one Byte for each object, not one Bit. [Bug #6006] patched by Sokolov Yura. https://github.com/ruby/ruby/pull/92 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (HEAP_ALIGN_LOG): HEAP_ALIGN_LOG should be pagenari2012-01-311-1/+3
| | | | | | | | size in OpenBSD. [ruby-core:42158][Bug #5901] * gc.c : avoid to redefine. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (HEAP_ALIGN, HEAP_ALIGN_MASK): DRY, let compiler calculatenobu2012-01-271-2/+2
| | | | | | | from HEAP_ALIGN_LOG. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (aligned_malloc, aligned_free): covered missing definednobu2012-01-171-4/+4
| | | | | | | operators and fixes for cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_mimmalloc): don't set allocated size to header.nagachika2012-01-111-3/+6
| | | | | | | | | | 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
* * gc.c (HEAP_OBJ_LIMIT): suppress narrowing down warning from gcc 4.2.nobu2012-01-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: in fact, i686-linux doesn't need to define _XOPEN_SOURCE 600.naruse2012-01-101-3/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_mimmalloc): defined for objects need not rb_objspace,naruse2012-01-101-0/+18
| | | | | | | | | | | | | | | | | 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
* * gc.c (run_finalizer): clear rb_thread_t::errinfo when ignorenagachika2012-01-091-0/+3
| | | | | | 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
* * gc.c : don't embed struct heaps_slot to a heap block because itnari2012-01-091-13/+30
| | | | | | | 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
* * gc.c: free_slots is changed Singly linked list. clearnari2012-01-091-15/+7
| | | | | | free_slots before sweep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: i686-linux needs to define _XOPEN_SOURCE 600 for posix_memalign.naruse2012-01-081-3/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_objspace_free): global_List is allocated with xmalloc.naruse2012-01-081-1/+1
| | | | | | | | | | | | | | | | | | | 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
* * gc.c : consider header bytes which are used by malloc.nari2012-01-081-7/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (aligned_free): support MinGW. Patch by Hiroshi Shirosaki.nari2012-01-081-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (slot_sweep): add a assertion instead of a debug print.nari2012-01-081-3/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: get rid of implicit narrowing conversion.kosaki2012-01-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: check posix_memalign(3) and menalign(3).naruse2012-01-071-5/+8
| | | | | | | | * 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
* * gc.c: use Bitmap Marking algorithm to avoid copy-on-write ofnari2012-01-071-110/+227
| | | | | | | | | | | | | | | | | 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
* * node.h, node.c, parse.y: implement a parser part for keyword arguments. ↵mame2011-12-261-3/+5
| | | | | | | | 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
* * node.h, parse.y (new_args_gen), compile.c (iseq_set_arguments): use struct ↵mame2011-12-261-1/+17
| | | | | | | | 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
* * bignum.c (big_rshift), compile.c (validate_label,nobu2011-12-051-0/+1
| | | | | | | | | | | | | | 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
* * gc.c (initial_params): static. it seems to be forgetten at r33501.usa2011-11-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (initial_params): pack in a struct.nobu2011-10-211-4/+19
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e