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

50759 Коммитов

Автор SHA1 Сообщение Дата
nobu 27e972854c common.rb: unused constant
* lib/uri/common.rb (URI::HTML5ASCIIINCOMPAT): remove the constant
  which has been unused since r40460, and wrong since r49069 due
  to the operator precedence.  [ruby-core:86678] [Bug #14711]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-25 11:56:58 +00:00
eregon 512041bf62 Avoid "should_not raise_error" in Thread#raise spec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-25 08:16:09 +00:00
eregon 9498d66c5d Fix style in Thread#raise spec
* Add space after { and before }.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-25 08:15:58 +00:00
eregon 66058dd546 Use Thread.pass in loop{} to check interrupts more often
* The spec now runs in ~5ms vs ~100ms before.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-25 08:11:01 +00:00
nobu 067066fc9b compile.c: fix unconditional branch optimization
* compile.c (iseq_peephole_optimize): add dummy `putnil` after a
  `jump` replacing an unconditional branch, to adjust removed
  `dup`.  [ruby-core:86666] [Bug #14708]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-25 06:45:05 +00:00
svn b768dc2207 * 2018-04-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-24 20:32:00 +00:00
normal acbbf8b0ca eval.c (ruby_setup): disable THP on Linux
Transparent Huge Pages (THP) decrease the effectiveness of
CoW-friendly GC because it decreases page granularity.  That is,
a forked process dirtying one bit of CoW-shared memory can
trigger a copy of a huge page (2MB on x86-64) instead of a smaller,
standard page (4K).

* eval.c (ruby_setup): disable THP on Linux
  [ruby-core:86651] [Feature #14705]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-24 20:31:59 +00:00
nobu 2c8f16e6c0 string.c: fix scanned substring with `\K`
* string.c (scan_once): fix the matched substring with `\K`, the
  beginning of that string may differ from the matched position.
  [ruby-core:86663] [Bug #14707]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-24 12:25:46 +00:00
nobu 3471d0f6d6 rescue Errno::EPROTOTYPE
* test/webrick/test_httpserver.rb (test_gigantic_request_header):
  Errno::EPROTOTYPE is sometimes raised on Mac OS X 10.10.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-23 23:46:26 +00:00
svn 6c4cab00cd * 2018-04-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-23 16:20:46 +00:00
k0kubun f84efbaa0f revert r63212
except test_jit.rb.

In some situations, this generates a wrong code. I'll add a test for it
later but let me revert this to make it work for now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-23 16:20:45 +00:00
nobu 4cae5353c0 compile.c: copy a short insn with leave
* compile.c (iseq_peephole_optimize): copy not only `leave`, with
  a non-operand instruction, which are not longer than `jump`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-23 12:51:18 +00:00
kazu 425118b898 [DOC] URI::Generic#port returns Integer [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-23 12:09:21 +00:00
nobu c6ad7a6272 compile.c: insn before pop
* compile.c (iseq_peephole_optimize): more eliminatable
  instructions before `pop` without side effects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-23 09:52:23 +00:00
normal 87ca4f3065 test/ruby/test_io.rb: add extra Thread#join to delay close
Maybe this fixes some CI failures.  Also, use different timeouts
for each item for hopefully easier diagnosis.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-23 05:54:06 +00:00
nobu 1222560ad1 thread_pthread.c: fallback to CLOCK_REALTIME
* thread_pthread.c (Init_native_thread): fallback to the default
  CLOCK_REALTIME when failed to set to CLOCK_MONOTONIC, e.g. on
  Solaris.  [Misc #14497]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-23 02:07:11 +00:00
normal c4056a4a70 net/imap: set SO_KEEPALIVE on TCP sockets
Otherwise connections (commonly on IDLE, but it could be any
command) may never receive notifications of link errors.

[ruby-core:86628] [Feature #14703]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 21:21:06 +00:00
stomar 75e5a91e92 sprintf.c: fix typo
* sprintf.c: [DOC] fix typo.
  Patch by Lazarus Lazaridis (iridakos).  [Fix GH-1789]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 19:41:06 +00:00
ko1 532464d178 Same as the last commit (comment out tests for CI).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 16:33:49 +00:00
svn fdf2764e2a * 2018-04-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 16:03:10 +00:00
ko1 dd45691dbc Skip some tests to make CI healthy.
r63236 (or r63237) introduces test failures and CI shows errors.
This commit makes skipping these tests.  Please revert this commit
after tests (and rubyspec) work fine.

Failure log example:
https://gist.github.com/ko1/8456cf25fe35a696bd33ac86135092e4


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 16:03:09 +00:00
normal ed590bdbfc thread*: all condvars are monotonic
There's no reason to use CLOCK_REALTIME for any condvars in Ruby.
Indeed, we initialized all condvars with RB_CONDATTR_CLOCK_MONOTONIC
anyway; so simplify our code and reduce ifdefs.

[ruby-core:85639] [Misc #14497]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 12:09:07 +00:00
kou 7a6f34103d rexml: Fix XPath bug of //#{ELEMENT_NAME}[#{POSITION}]
The position should be counted for each nodeset but the previous
implementation counts position for union-ed nodeset.

For example, "/a/*/*[1]" should be matched to "<c1/>" and "<c2/>" with
the following XML.

    <a>
      <b>
        <c1/>
      </b>
      <b>
        <c2/>
      </b>
    </a>

But the previous implementation just returns only "<c1/>".

* lib/rexml/element.rb (REXML::Attributes#each_attribute):
  Support Enumerator for no block use.

* lib/rexml/element.rb (REXML::Attributes#each):
  Support Enumerator for no block use.

* lib/rexml/functions.rb (REXML::Functions.string):
  Support NaN again.

* lib/rexml/xpath_parser.rb: Re-implement "Step" evaluator.
  It should evaluate "AxisSpecifier", "NodeTest" and "Predicate" in one
  step to respect position for each nodeset.

* test/rexml/test_jaxen.rb: Enable more tests. Remained tests should
  be also enabled but it'll not be near future.

* test/rexml/xpath/test_base.rb: Fix expected value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 09:38:06 +00:00
kou 4d15e619eb rexml: Fix XPath bug of /#{ELEMENT_NAME}
It doesn't mean that all elements which name "ELEMENT_NAME" with any
namespace URI including null namespace URI. It means that all elements
which name "ELEMENT_NAME" with null namespace URI.

https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-NodeTest

> if the QName does not have a prefix, then the namespace URI is null
> (this is the same way attribute names are expanded).

We need to use "*[local-name()='#{ELEMENT_NAME}']" for all elements
which name "ELEMENT_NAME" with any namespace URI including null
namespace URI in XPath 1.0. But it's inconvenient. So this change
includes "*:#{LOCAL_NAME}" syntax support that is introduced since
XPath 2.0.

* lib/rexml/parsers/xpathparser.rb: Support "*:#{LOCAL_NAME}" syntax that
  is introduced since XPath 2.0.

* lib/rexml/xpath_parser.rb:
  * Fix namespace URI processing for "#{ELEMENT_NAME}". Now,
    "#{ELEMENT_NAME}" doesn't accept elements with null namespace URI.
  * Add "*:#{LOCAL_NAME}" support.

* test/rexml/test_contrib.rb,
  test/rexml/test_core.rb,
  test/rexml/xpath/test_base.rb: Follow this change.

* test/rexml/test_jaxen.rb: Fix namespace processing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 08:09:04 +00:00
k0kubun b252d8ada3 mjit_compile.c: comment the intention of r63092 [ci skip]
It's for "leave" instruction.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 04:01:23 +00:00
nobu 56e87b2c4b made *.cmd excutable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 00:47:56 +00:00
nobu 04ac0363bb made *.cmd excutable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 00:46:08 +00:00
nobu 0b429ad269 Makefile.in: MJIT_ARCHFLAG
* Makefile.in (mjit_config.h): separate MJIT_ARCHFLAG for each
  architecture on universal binary.  cannot use precompiled-header
  with multiple -arch options.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 00:02:56 +00:00
normal fed7f81b37 test/ruby/test_io.rb: try to diagnose stuck test_recycled_fd_close
I can't reproduce the problem myself, but gets loop seems ought
to give more useful information for tracking down where we're
stuck, at least.

Followup-to: r63217

cf. http://ci.rvm.jp/results/trunk-test@frontier/804284

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 23:32:18 +00:00
nobu c83decf69a mjit.c: check pch status
* mjit.c (mjit_add_iseq_to_process, mjit_get_iseq_func): check if
  pch failed before timedout.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 23:02:21 +00:00
svn 83bd262f92 * 2018-04-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 20:04:06 +00:00
stomar 300b22dc22 Improve docs for URI library
* lib/uri/generic.rb: [DOC] fix invalid example code to make it
  syntax highlighted; drop unnecessary `puts', `p'; adapt to current
  inspect format without Object id; do not display unnecessary return
  values in examples; fix or prevent unintended description lists;
  fix broken RDoc; fix grammar and typos.

* lib/uri.rb: ditto.
* lib/uri/common.rb: ditto.
* lib/uri/file.rb: ditto.
* lib/uri/ftp.rb: ditto.
* lib/uri/http.rb: ditto.
* lib/uri/ldap.rb: ditto.
* lib/uri/mailto.rb: ditto.
* lib/uri/rfc2396_parser.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 20:04:05 +00:00
k0kubun c04881f94a test_jit.rb: follow the change of instruction
in r63225. Not strictly needed but to avoid confusion.

The JIT compiler itself seems working fine.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 13:15:43 +00:00
nobu fde115b13c compile.c: optimize checktype
* compile.c (optimize_checktype): optimize `checktype` instruction
  on a literal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 10:52:53 +00:00
nobu a3fe1034c4 insns.def: checktype
* insns.def (checktype): split branchiftype to checktype and
  branchif, to make branch condition negation possible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 10:52:52 +00:00
nobu c458aeffd1 compile.c: renamed macro arguments
* compile.c (INSERT_BEFORE_INSN, INSERT_BEFORE_INSN1): rename
  argument `prev` as `next`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 07:48:36 +00:00
kou ee29985ded rexml: Enable more tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 06:45:42 +00:00
kou da89931dcc rexml: Fix XPath concat() implementation
* lib/rexml/functions.rb (REXML::Functions.concat): Implement.

* test/rexml/test_jaxen.rb: Enable one more test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 06:43:58 +00:00
kou 6793c0a227 rexml: Fix XPath string() implementation
* lib/rexml/functions.rb( REXML::Functions.string):
  * Support context node.
  * Fix implementation for document node to remove out of root nodes.
  * Support processing instruction node.
  * Improve implementation for integer to omit decimals.

* test/rexml/test_jaxen.rb: Enable processing instruction test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 06:39:43 +00:00
kou e044924ee5 rexml: Make more readable
test/rexml/test_jaxen.rb: Use more meaningful name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 06:21:41 +00:00
kou 1992cec52d rexml: Fix a test bug
test/rexml/test_jaxen.rb: Fix wrong assert_raise usage. Note that this code
isn't used yet.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 06:21:02 +00:00
kou daec80fe98 rexml: Make more readable
test/rexml/xpath/test_base.rb: Use here document for readability.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 06:18:08 +00:00
normal 7e9c19ad3d test/ruby/test_io.rb: add closing recycled FD test
Followup-to: r63216

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 04:02:41 +00:00
normal 645f7fbd4e io.c: do not use rb_notify_fd_close close on recycled FD
It is unsafe to release GVL and call rb_notify_fd_close after
close(2) on any given FD.  FDs (file descriptor) may be recycled
in other threads immediately after close() to point to a different
file description.  Note the distinction between "file description"
and "file descriptor".

th-1                           | th-2
-------------------------------+---------------------------------------
io_close_fptr                  |
  rb_notify_fd_close(fd)       |
  fptr_finalize_flush          |
    close(fd)                  |
  rb_thread_schedule           |
                               | fd reused (via pipe/open/socket/etc)
  rb_notify_fd_close(fd)       |
                               | sees "stream closed" exception
			       |   for DIFFERENT file description

* thread.c (rb_thread_io_blocking_region): adjust comment for list_del
* thread.c (rb_notify_fd_close): give busy list to caller
* thread.c (rb_thread_fd_close): loop on busy list
* io.c (io_close_fptr): do not call rb_thread_fd_close on invalid FD
* io.c (io_reopen): use rb_thread_fd_close

Fixes: r57422 ("io.c: close before wait")

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 03:12:36 +00:00
normal af72dcd91b thread_sync: redo r62934 to use fork_gen
Instead of maintaining linked-lists to store all
rb_queue/rb_szqueue/rb_condvar structs; store only a fork_gen
serial number to simplify management of these items.

This reduces initialization costs and avoids the up-front cost
of resetting all Queue/SizedQueue/ConditionVariable objects at
fork while saving 8 bytes per-structure on 64-bit.  There are no
savings on 32-bit.

* thread.c (rb_thread_atfork_internal): remove rb_thread_sync_reset_all call
* thread_sync.c (rb_thread_sync_reset_all): remove
* thread_sync.c (queue_live): remove
* thread_sync.c (queue_free): remove
* thread_sync.c (struct rb_queue): s/live/fork_gen/
* thread_sync.c (queue_data_type): use default free
* thread_sync.c (queue_alloc): remove list_add
* thread_sync.c (queue_fork_check): new function
* thread_sync.c (queue_ptr): call queue_fork_check
* thread_sync.c (szqueue_free): remove
* thread_sync.c (szqueue_data_type): use default free
* thread_sync.c (szqueue_alloc): remove list_add
* thread_sync.c (szqueue_ptr):  check fork_gen via queue_fork_check
* thread_sync.c (struct rb_condvar): s/live/fork_gen/
* thread_sync.c (condvar_free): remove
* thread_sync.c (cv_data_type): use default free
* thread_sync.c (condvar_ptr): check fork_gen
* thread_sync.c (condvar_alloc): remove list_add
  [ruby-core:86316] [Bug #14634]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20 22:53:37 +00:00
svn 730d257b5a * 2018-04-21
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20 21:38:28 +00:00
normal 475b4aa40b simplify altstack and enable reuse with thread cache
Instead of allocating and registering the altstack in different
places, do it together to reduce code and improve readability.
When thread cache is enabled, storing altstack in rb_thread_t
is wasteful and we may reuse altstack in the same pthread.

This also lets us clearly allow use of xmalloc to allow GC to
recover from ENOMEM.

[ruby-core:85621] [Feature #14487]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20 21:38:27 +00:00
k0kubun e72a86fc93 _mjit_compile_send.erb: inline attr_reader call
_mjit_compile_send_guard.erb: carve out the shared logic to invalidate
inlined method call

common.mk: update dependency for this change

test_jit.rb: add test for attr_reader optimization

* Benchmark

```
require 'benchmark_driver'

Benchmark.driver do |x|
  x.prelude %{
    class C
      attr_reader :a
      def initialize
        @a = 1
      end
    end

    o = C.new

    def l o
      i = 0
      while i < 1000000
        o.a
        i += 1
      end
    end
  }
  x.report 'aread', %{ l o }
  x.loop_count 1000

  x.rbenv 'before', 'before,--jit', 'after,--jit'
  x.verbose
end
```

```
before: ruby 2.6.0dev (2018-04-20 trunk 63211) [x86_64-linux]
before,--jit: ruby 2.6.0dev (2018-04-20 trunk 63211) +JIT [x86_64-linux]
after,--jit: ruby 2.6.0dev (2018-04-20 trunk 63211) +JIT [x86_64-linux]
last_commit=_mjit_compile_send.erb: inline attr_reader call
Calculating -------------------------------------
                         before  before,--jit  after,--jit
               aread     54.597       122.894      218.574 i/s -      1.000k times in 18.316102s 8.137089s 4.575106s

Comparison:
                            aread
         after,--jit:       218.6 i/s
        before,--jit:       122.9 i/s - 1.78x  slower
              before:        54.6 i/s - 4.00x  slower

```

* Optcarrot

A little made faster?

fps: 71.35 -> 72.11

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20 13:42:08 +00:00
hsbt 1658fb3f83 Update latest bundled gems:
did_you_mean: 1.2.1
  rake: 12.3.1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20 07:10:53 +00:00
normal b456eab2ea variable.c: fix thread + fork errors in autoload
This is fairly non-intrusive bugfix to prevent children
from trying to reach into thread stacks of the parent.
I will probably reuse this idea and redo r62934, too
(same bug).

* vm_core.h (typedef struct rb_vm_struct): add fork_gen counter
* thread.c (rb_thread_atfork_internal): increment fork_gen
* variable.c (struct autoload_data_i): store fork_gen
* variable.c (check_autoload_data): remove (replaced with get_...)
* variable.c (get_autoload_data): check fork_gen when retrieving
* variable.c (check_autoload_required): use get_autoload_data
* variable.c (rb_autoloading_value): ditto
* variable.c (rb_autoload_p): ditto
* variable.c (current_autoload_data): ditto
* variable.c (autoload_reset): reset fork_gen, adjust indent
* variable.c (rb_autoload_load): set fork_gen when setting state
* test/ruby/test_autoload.rb (test_autoload_fork): new test
  [ruby-core:86410] [Bug #14634]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20 03:22:26 +00:00