Permalink
Commits on Nov 2, 2012
  1. Stop calling to_path of String

    * file.c (rb_get_path_check_to_string): stop calling to_path method of String.
      We remove unnecessary argument.
    
    * file.c (rb_get_path_check): follow the above change.
    
    * internal.h (rb_get_path_check_to_string): ditto.
    
    * load.c (rb_construct_expanded_load_path): not check to have to_path method
      since to_path is not called for String.
    
    * load.c (rb_get_expanded_load_path): fix comment.
    
    * test/ruby/test_require.rb (TestRequire): remove invalid test.
    committed Nov 2, 2012
Commits on Nov 1, 2012
  1. Support to_path and to_str method of load path

    * file.c (rb_get_path_check_to_string): extract from rb_get_path_check().
      Add an argument to check to have to_path method.
    
    * file.c (rb_get_path_check_convert): extract from rb_get_path_check().
    
    * file.c (rb_get_path_check_to_string): move from rb_get_path_check().
    
    * file.c (rb_file_expand_path_fast): remove check_expand_path_args().
      Instead we call it in load.c.
    
    * internal.h (rb_get_path_check_to_string, rb_get_path_check_convert):
      add declarations.
    
    * load.c (rb_construct_expanded_load_path): add checks in
      rb_get_path_check(). We don't freeze non string object and expand it
      every times. We expand string object which has to_path method every times.
    
    * load.c (rb_get_expanded_load_path): expand non-cacheable objects every
      times.
    
    * load.c (rb_feature_provided): call rb_get_path() since we changed
      rb_file_expand_path_fast() not to call it.
    
    * load.c (Init_load): rename to load_path_check_cache for changed usage.
    * vm.c (rb_vm_mark): ditto.
    * vm_core.h (rb_vm_struct): ditto.
    
    * test/ruby/test_require.rb (TestRequire): add tests for compatibility
      of to_path and to_str in $LOAD_PATH.
    committed Nov 1, 2012
  2. Fix compatibility of require

    * load.c (rb_construct_expanded_load_path): don't replace $LOAD_PATH.
      We just freeze contents of $LOAD_PATH. We add an argument for home
      directory expansion.
    
    * load.c (rb_get_expanded_load_path): expand path which starts with ~
      always for compatibility.
    
    * test/ruby/test_require.rb (TestRequire): add tests for require
      compatibility.
      - not modify load path contents
      - require when ENV['HOME'] is changed
    committed Oct 29, 2012
  3. Use rb_get_expanded_load_path() in find file

    * file.c (rb_find_file_ext_safe): use rb_get_expanded_load_path() to reduce
      expand cost.
    
    * file.c (rb_find_file_safe): ditto.
    
    * internal.h (rb_get_expanded_load_path): add a declaration.
    
    * load.c (rb_get_expanded_load_path): make it accesible from other source
      files.
    committed Oct 27, 2012
  4. Cache expanded relative load path

    * load.c (rb_construct_expanded_load_path): check relative path.
      We call getcwd() only if load path has relative path, to avoid getcwd() failure.
    
    * load.c (load_path_getcwd): add a function to get current working directory.
    
    * load.c (rb_get_expanded_load_path): check if current working directory is changed
      and rebuild expanded load path cache.
    
    * load.c (Init_load): initialize vm->load_path_cwd.
    
    * test/ruby/test_require.rb (TestRequire#test_require_): add a test for require
      when changeing current working directory.
    
    * vm.c (rb_vm_mark): mark vm->load_path_cwd.
    
    * vm_core.h (rb_vm_struct): add vm->load_path_cwd to store current working directory
      to check if expanded load path cache is invalid.
    committed Oct 27, 2012
  5. Expand relative load path always

    * load.c (rb_construct_expanded_load_path): add a option for expanding
      only relative load paths.
    
    * load.c (rb_get_expanded_load_path): expand relative load path always.
    committed Oct 31, 2012
  6. Cache the expanded load path

    * load.c (rb_get_expanded_load_path): cache the expanded load
      path.  This saves 4KB of allocation and some stats for every
      element of the load path (so nearly a MB in my Rails app)
      on every require.
    
    * load.c (rb_construct_expanded_load_path): ensure that $LOAD_PATH
      entries are frozen strings.  The user must mutate $LOAD_PATH
      itself rather than its individual entries.
    
    * vm_core.h (rb_vm_struct): add fields.
    
    * vm.c (rb_vm_mark): mark new fields.
    
    * ruby.c (process_options): modify $LOAD_PATH directly rather than
      its elements.
      [ruby-core:47970] [Bug #7158]
    committed Nov 1, 2012
  7. Index $LOADED_FEATURES so that require isn't so slow

    * load.c (rb_feature_p, rb_provide_feature): index $LOADED_FEATURES
      so that require isn't so slow.
    
    * load.c (rb_provide_feature, get_loaded_features_index): ensure
      that $LOADED_FEATURES entries are frozen strings.  The user
      must mutate $LOADED_FEATURES itself rather than its individual
      entries.
    
    * load.c (reset_loaded_features_snapshot): add a new function to reset
      vm->loaded_features_snapshot.
    
    * load.c (get_loaded_features_index_raw): add a new function to get
      the loaded-features index.
    
    * load.c (features_index_add_single): add a new function to add to the
      loaded-features index a single feature.
    
    * load.c (features_index_add): add a new function to add to the
      loaded-features index all the required entries for `feature`.
    
    * vm_core.h (rb_vm_struct): add fields.
    
    * vm.c (rb_vm_mark): mark new fields.
    
    * include/ruby/intern.h (rb_hash_clear): declare function.
    
    * hash.c (rb_hash_clear): make function non-static.
      [ruby-core:47970] [Bug #7158]
    committed Nov 1, 2012
  8. Expose whether two arrays are shared

    * array.c (rb_ary_shared_with_p): new function.
      Expose whether two arrays are shared (read-only, C only).
    
    * include/ruby/intern.h (rb_ary_shared_with_p): declare.
      [ruby-core:47970] [Bug #7158]
    committed Nov 1, 2012
  9. Clarify and explain loaded_feature_path and rb_feature_p

    * load.c (loaded_feature_path): clarify and briefly comment
      function.  These clarifications have no effect on the behavior
      of the function.
    
    * load.c (rb_feature_p): explain the search loop.  Especially
      useful because the logic is complicated as described in the
      second paragraph.
      [ruby-core:47970] [Bug #7158]
    committed Nov 1, 2012
Commits on Oct 31, 2012
  1. @authorNari

    * gc.c (gc_profile_record): don't define unused variables when

      GC_PROFILE_MORE_DETAIL is 0.
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    authorNari committed Oct 31, 2012
  2. @authorNari

    * gc.c (gc_prof_mark_timer_stop): count is not initialized.

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    authorNari committed Oct 31, 2012
  3. @drbrain

    * thread.c (rb_thread_call_without_gvl2): Note that ubf() may or may

      not be called with the GVL.  Hinted that rb_thread_call_with_gvl()
      can be used to access ruby functionality.  [ruby-trunk - #6433]
    
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    drbrain committed Oct 31, 2012
  4. @drbrain

    * thread.c (rb_thread_call_without_gvl2): Update documentation to

      natural English.
    * thread.c (rb_thread_call_with_gvl):  ditto.
    
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    drbrain committed Oct 31, 2012
Commits on Oct 30, 2012
  1. * 2012-10-31

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    svn committed Oct 30, 2012
  2. @tenderlove

    * ext/dl/lib/dl/struct.rb: fix strange require order. [ruby-dev:45702]

    * ext/dl/lib/dl/value.rb: ditto
    
    * test/dl/test_c_struct_entry.rb: remove strange require order from
      tests.
    
    * test/dl/test_c_union_entity.rb: ditto
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    tenderlove committed Oct 30, 2012
  3. @shugo

    * eval.c (rb_mod_refine): fix the error message when no block is

      given.  [ruby-dev:46319] [Bug #7244]
    
    * test/ruby/test_refinement.rb: related test.
    
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    shugo committed Oct 30, 2012
  4. @znz

    fix typos

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    znz committed Oct 30, 2012
  5. @unak

    * process.c (redirect_dup2): set standard handles when new fd is stdio,

      because if there is no allocated console at the moment Windows does
      not automatically associate it for child process's standard handle.
      this is adhoc workaround.
      reported by Martin Thiede at [ruby-core:48542] [Bug #7239].
    
    * io.c (rb_cloexec_dup2): ditto.
    
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    unak committed Oct 30, 2012
  6. @nurse

    Check if there is no error before reconnect [Bug #4387]

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    nurse committed Oct 30, 2012
Commits on Oct 29, 2012
  1. @nobu

    rbconfig/obsolete.rb: Config

    * lib/rbconfig/obsolete.rb (Config): re-introduce warnings for a
      lame-duck.  [ruby-core:46836] [Bug #6809]
    
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    nobu committed Oct 29, 2012
  2. * 2012-10-30

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    svn committed Oct 29, 2012
  3. @tenderlove

    * thread.c: added Thread#thread_variable_(get|set),

      Thread#thread_variable?, and Thread#thread_variables for operating
      on variables that are local to threads. [ruby-core:47790]
    
    * vm.c: ditto
    
    * test/ruby/test_thread.rb: tests for thread variables.
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    tenderlove committed Oct 29, 2012
  4. @nobu

    load.c: adjust style

    * load.c (loaded_feature_path): adjust style.
    
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    nobu committed Oct 29, 2012
  5. @nobu

    stringio.c: close separatedly

    * ext/stringio/stringio.c (strio_close): close separatedly per each
      instances, as well as IO.
    
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    nobu committed Oct 29, 2012
  6. @nurse

    Use assert_normal_exit to split process

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    nurse committed Oct 29, 2012
  7. @nobu

    gc.c: PRIuSIZE

    * gc.c (gc_profile_dump_on): use PRIuSIZE instead of 'zu'.
    
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    nobu committed Oct 29, 2012
  8. @nobu

    * properties.

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    nobu committed Oct 29, 2012
  9. @tenderlove

    * ext/psych/lib/psych/handlers/recorder.rb: added a class for

      recording YAML parse and emit events.
    
    * ext/psych/lib/psych/handler.rb: adding a list of events so that
      handler classes can more easily be meta-programmed.
    
    * test/psych/handlers/test_recorder.rb: tests for the change.
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    tenderlove committed Oct 29, 2012
Commits on Oct 28, 2012
  1. @marcandre

    Update Changelog

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    marcandre committed Oct 28, 2012
  2. @marcandre

    * lib/ostruct.rb: Add [] and []=, base on a patch by Thomas Sawyer

    [ruby-core:42779] [Feature #6056]
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    marcandre committed Oct 28, 2012
  3. @marcandre

    * lib/ostruct.rb: Also accept {Open}Struct as argument to new

    [ruby-core:47476] [Feature #7007]
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    marcandre committed Oct 28, 2012
  4. @marcandre

    * lib/ostruct.rb: Simplify code

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    marcandre committed Oct 28, 2012
  5. @marcandre

    * lib/ostruct.rb: Add OpenStruct#eql? and OpenStruct#hash

    [ruby-core:42651] [Bug #6029]
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    marcandre committed Oct 28, 2012
  6. @marcandre

    * lib/ostruct.rb (each_pair): Add #each_pair [#1400]

    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    marcandre committed Oct 28, 2012