summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-07-19* expand tabs.git
2019-07-19fix shared array terminology.Koichi Sasada
Shared arrays created by Array#dup and so on points a shared_root object to manage lifetime of Array buffer. However, sometimes shared_root is called only shared so it is confusing. So I fixed these wording "shared" to "shared_root". * RArray::heap::aux::shared -> RArray::heap::aux::shared_root * ARY_SHARED() -> ARY_SHARED_ROOT() * ARY_SHARED_NUM() -> ARY_SHARED_ROOT_REFCNT() Also, add some debug_counters to count shared array objects. * ary_shared_create: shared ary by Array#dup and so on. * ary_shared: finished in shard. * ary_shared_root_occupied: shared_root but has only 1 refcnt. The number (ary_shared - ary_shared_root_occupied) is meaningful.
2019-07-19In some situations, `vm_stack` can be NULL, but `cfp` is valid.Samuel Williams
2019-07-19Add assertions to `coroutine_initialize_main`.Samuel Williams
2019-07-19Split assertions to check which one fails.Samuel Williams
2019-07-19Better usage of `rb_ec_clear_vm_stack` to maintain invariants.Samuel Williams
2019-07-19Improve ec assertions.Samuel Williams
2019-07-19respect NDEBUG.Koichi Sasada
ruby/ruby.h includes ruby/assert.h, and RUBY_NDEBUG is defined by checking NDEBUG. In other words, NDEBUG is only seen just after ruby/ruby.h. This patch also cheks NDEBUG just after including ruby_assert.h. Without this patch, assertions in array.c are always enabled.
2019-07-19Remove doc/etc.rd.ja [ci skip]Kazuhiro NISHIYAMA
[Feature #16003] [ruby-dev:50814]
2019-07-19initialize only Fiber's cfp.Koichi Sasada
fiber->cont.saved_ec.cfp should be initialized by NULL because no vm_stack is allocated. However, cont_init() captures current Fiber's cfp for continuation, so it should only initialize fibers.
2019-07-19Revert "Ensure cfp is initialized to NULL."Samuel Williams
This reverts commit d7fdf45a4ae1bcb6fac30a24b025d4f20149ba0a.
2019-07-19Fix showing doc of "nil.to_s", nil doesn't have #nameaycabta
2019-07-19Ensure cfp is initialized to NULL.Samuel Williams
`cont_init` didn't initialize `cont->saved_ec.cfp`. Calling `cont_mark` would result in an invalid `cfp` in `rb_execution_context_mark`. Because fibers lazy-initialize the stack, fibers that are created but not resumed could cause this problem to occur.
2019-07-19Remove `rb_vm_push_frame` as it is no longer used.Samuel Williams
2019-07-19Ripper#validate_object: check if the object is hiddenNobuyoshi Nakada
2019-07-19Update before commitNobuyoshi Nakada
2019-07-19Moved RIPPER_DEBUG methods to Ripper from KernelNobuyoshi Nakada
2019-07-19Fixed build error with RIPPER_DEBUGNobuyoshi Nakada
2019-07-19* 2019-07-19git
2019-07-19Adjust styles and indentsNobuyoshi Nakada
2019-07-19Use Qnull instead of 0 and QundefNobuyoshi Nakada
2019-07-18check saved_ec.cfpKoichi Sasada
2019-07-19Ensure we don't have dangling cfp.Samuel Williams
2019-07-18* remove trailing spaces.git
2019-07-18Improve `fiber_pool_expand` allocation strategy.Samuel Williams
If `mmap` fails to allocate memory, try half the size, and so on. Limit FIBER_POOL_ALLOCATION_MAXIMUM_SIZE to 1024 stacks. In typical configurations this limits the memory mapped region to ~128MB per allocation.
2019-07-18Add experimental `RUBY_SHARED_FIBER_POOL_FREE_STACKS` to control madvise.Samuel Williams
2019-07-18Add note about setting `vm.max_map_count` for Linux.Samuel Williams
2019-07-18Make fiber_pool more conservative on platforms with limited address space.Samuel Williams
We use COROUTINE_LIMITED_ADDRESS_SPACE to select platforms where address space is 32-bits or less. Fiber pool implementation enables more book keeping, and reduces upper limits, in order to minimise address space utilisation.
2019-07-18Add `struct fiber_pool {int free_stacks;}` to control usage of madvise.Samuel Williams
`madvise(free)` and similar operations are good because they avoid swap usage by clearing the dirty bit on memory pages which are mapped but no longer needed. However, there is some performance penalty if there is no memory pressure. Therefore, we do it by default, but it can be avoided.
2019-07-18Add FIBER_POOL_ALLOCATION_FREE to control allocation/free strategy.Samuel Williams
2019-07-18Limit expansion of fiber pool on 32-bit platforms.Samuel Williams
On 32-bit platforms, expanding the fiber pool by a large amount may fail, even if a smaller amount may succeed. We limit the maximum size of a single allocation to maximise the number of fibers that can be allocated. Additionally, we implement the book-keeping required to free allocations when their usage falls to zero.
2019-07-18Enable `madvise` to release stack space back to OS.Samuel Williams
2019-07-18Add details of fiber pool and coroutine selection to NEWS.Samuel Williams
2019-07-18Add `ucontext` and `copy` coroutine implementations to test matrix.Samuel Williams
2019-07-18Improve build process and coroutine implementation selection.Samuel Williams
2019-07-18Stack copying implementation of coroutines.Samuel Williams
2019-07-18Remove unused vm_stack recycling.Samuel Williams
2019-07-18Implement fiber pool for reduced fiber allocation overhead.Samuel Williams
Replace previous stack cache with fiber pool cache. The fiber pool allocates many stacks in a single memory region. Stack allocation becomes O(log N) and fiber creation is amortized O(1). Around 10x performance improvement was measured in micro-benchmarks.
2019-07-18Make FIBER_USE_NATIVE the default and reformat code.Samuel Williams
2019-07-18* 2019-07-18git
2019-07-18Add benchmark to help diagnose performance regression.Samuel Williams
See https://bugs.ruby-lang.org/issues/16009 for more details.
2019-07-17* expand tabs.git
2019-07-17compile.c: add NO_CHECK for the calls to COMPILE whose result is unusedYusuke Endoh
to suppress many warnings of Coverity Scan
2019-07-17Adjust indent [ci skip]Nobuyoshi Nakada
2019-07-17Get rid of LoadError with $DEBUGNobuyoshi Nakada
2019-07-17Separate pull-github from merge-github [ci skip]Nobuyoshi Nakada
2019-07-17* 2019-07-17git
2019-07-17Expanded buf to copy at onceNobuyoshi Nakada
Build dumped string from base packed data and extended year at once. Although currently ruby_marshal_write_long() never writes more than 5 bytes per its format specification, allocate `sizeof(long)+1` for the sanitation.
2019-07-17Named the backward compatible dump sizeNobuyoshi Nakada
2019-07-16Removed twisted testsNobuyoshi Nakada
Why does only Process.daemon have these tests?