summaryrefslogtreecommitdiff
path: root/load.c
AgeCommit message (Collapse)Author
2014-12-03load.c: reset errinfonobu
* load.c (ruby_require_internal): ignore error detail, just return an error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-03encoding.c: load by rb_require_internalnobu
* encoding.c (load_encoding): use rb_require_internal instead of calling rb_require_safe with protection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-03load.c: defer static linked initnobu
* enc/encinit.c.erb (Init_enc): initialize encdb and transdb directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-03load.c: tweak the return valuenobu
* load.c (rb_require_internal): tweak the return value, 1 and 0 correspond to true and false in Kernel#require, respectively. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-03dmyenc.c: try to load encdbnobu
* load.c (ruby_require_internal): separate from rb_require_safe, not to raise exceptions. * ruby.c (process_options): remove unnatural encoding search. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* internal.h: Include ruby.h and ruby/encoding.h to beakr
includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-29load.c: transcode pathnobu
* load.c (rb_f_load): path name needs to be transcoded to OS path encoding. [ruby-list:49994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30protoize no-arguments functionsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-09* parse.y: change Symbol <-> ID relationship to avoidko1
exposing IDs from collectable symbols. [Bug #10014] Now, rb_check_id() returns 0 if corresponding symbol is pinned dynamic symbol. There is remaining intern_cstr_without_pindown(), it can return IDs from collectable symbols. We must be careful to use it (only used in parse.y). I think it should be removed if it does not have impact for performance. * parse.y: add: * STATIC_SYM2ID() * STATIC_ID2SYM() rename: * rb_pin_dynamic_symbol() -> dsymbol_pindown() * internal.h: remove: * rb_check_id_without_pindown() * rb_sym2id_without_pindown() add: * rb_check_symbol() * rb_check_symbol_cstr() * load.c: use rb_check_id() or rb_check_id_cstr(). * object.c: ditto. * struct.c: ditto. * thread.c: ditto. * vm_method.c: ditto. * string.c (sym_find): use only rb_check_symbol(). * sprintf.c (rb_str_format): use rb_check_symbol_cstr(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-26* parse.y: support Symbol GC. [ruby-trunk Feature #9634]nari
See this ticket about Symbol GC. * include/ruby/ruby.h: Declare few functions. * rb_sym2id: almost same as old SYM2ID but support dynamic symbols. * rb_id2sym: almost same as old ID2SYM but support dynamic symbols. * rb_sym2str: almost same as `rb_id2str(SYM2ID(sym))` but not pin down a dynamic symbol. Declare a new struct. * struct RSymbol: represents a dynamic symbol as object in Ruby's heaps. Add few macros. * STATIC_SYM_P: check a static symbol. * DYNAMIC_SYM_P: check a dynamic symbol. * RSYMBOL: cast to RSymbol * gc.c: declare RSymbol. support T_SYMBOL. * internal.h: Declare few functions. * rb_gc_free_dsymbol: free up a dynamic symbol. GC call this function at a sweep phase. * rb_str_dynamic_intern: convert a string to a dynamic symbol. * rb_check_id_without_pindown: not pinning function. * rb_sym2id_without_pindown: ditto. * rb_check_id_cstr_without_pindown: ditto. * string.c (Init_String): String#intern and String#to_sym use rb_str_dynamic_intern. * template/id.h.tmpl: use LSB of ID as a flag for determining a static symbol, so we shift left other ruby_id_types. * string.c: use rb_sym2str instead `rb_id2str(SYM2ID(sym))` to avoid pinning. * load.c: use xx_without_pindown function at creating temporary ID to avoid pinning. * object.c: ditto. * sprintf.c: ditto. * struct.c: ditto. * thread.c: ditto. * variable.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-02load.c (ruby_init_ext): make idempotent to suppress warningsnormal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14load.c: call initnobu
* load.c (register_init_ext): call initialization function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03* load.c (features_index_add_single): Move loaded_features_index array ↵tmm1
values off the ruby heap. [Bug #9201] [ruby-core:58805] * load.c (loaded_features_index_clear_i): Clean up off-heap array structure. * vm.c (rb_vm_mark): Remove unnecessary mark_tbl for loaded_features_index. This improves minor GC time by 15% in a large application. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-03load.c: defer initalization of static-linked-extnobu
* load.c (rb_feature_p): deal with default loadable suffixes. * load.c (load_lock): initialize statically linked extensions. * load.c (search_required, rb_require_safe): deal with statically linked extensions. * load.c (ruby_init_ext): defer initalization of statically linked extensions until required actually. [Bug #8883] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-01load.c: suppress warningnobu
* load.c (rb_load_internal): split to suppress false "clobbered" warning by gcc 4.4.5. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-01load.c: use local variablenobu
* load.c (rb_load_internal): use local variable th instead of GET_THREAD() for each time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28load.c: share feature namesnobu
* load.c (ruby_init_ext): share feature names between frame name and provided features. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-08load.c: display backtrace to $stderrnobu
* load.c (load_lock): display backtrace to $stderr at circular require. * vm_backtrace.c (rb_backtrace_print_to): new function to print backtrace to the given output. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-26load.c: search in OS path encodingnobu
* load.c (rb_load_internal): use rb_load_file_str() to keep path encoding. * load.c (rb_require_safe): search in OS path encoding for Windows. * ruby.c (rb_load_file_str): load file with keeping path encoding. * win32/file.c (rb_file_load_ok): use WCHAR type API assuming incoming path is encoded in UTF-8. [ruby-core:56136] [Bug #8676] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22load.c: suppress warningnobu
* load.c (rb_load_internal): suppress clobbered-by-longjmp warning by gcc 4.4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* internal.h (numberof): Gathered from various files.akr
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c, load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c, error.c, ruby.c: Remove the definitions of numberof. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-23load.c: fix invalid readnobu
* load.c (loaded_feature_path): fix invalid read by index underflow. the beginning of name is also a boundary as well as just after '/'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko1
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05* load.c (features_index_add): use rb_str_subseq() to specify C stringshirosaki
position properly to fix require non ascii path. [ruby-core:53733] [Bug #8165] * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path): a test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-24load.c: no longer used variable and objectnobu
* load.c (rb_feature_p): remvoe variable and string object which are no longer used since r39874. [Bug #8048] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-22load.c: loaded_features_index st_tablenobu
* load.c (rb_feature_p), vm_core.h (rb_vm_struct): turn loaded_features_index into st_table. patches by tmm1 (Aman Gupta) in [ruby-core:53251] and [ruby-core:53274] [Bug #8048] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-09fix commit missnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-09load.c: hide internal objectsnobu
* load.c (rb_construct_expanded_load_path, Init_load): hide internal objects, expanded_load_path, {load_path,loaded_features}_snapshot, and loaded_features_index in the VM, and ruby_dln_librefs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-08load.c: move loop invariant conditionnobu
* load.c (rb_feature_p): move this_feature_index condition which is loop invariant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-08load.c: reduce indexes arraysnobu
* load.c (features_index_add_single, rb_feature_p): store single index as Fixnum to reduce the number of arrays for the indexes. based on the patch by tmm1 (Aman Gupta) in [ruby-core:53216] [Bug #8048]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-08load.c: reorder conditionsnobu
* load.c (loaded_feature_path): reorder conditions so simple comparision comes first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-10* probes.d: updating probes to be more symmetrical, addingtenderlove
documentation. * load.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-09* load.c (load_lock): if thread shield is destroyed and there is noglass
waiting thread, insert new thread shield into load_table. [Bug #7530] [ruby-core:50645] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-09* load.c (load_lock): revert r38744. it should acquire new threadglass
shield. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-09* load.c (load_lock): fix not to delete thread shield twice.glass
it may break the shield locked by another thread. [Bug #7530] [ruby-core:50645] * test/ruby/test_require.rb: a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25error.c: rb_write_error_strnobu
* error.c (compile_err_append, compile_warn_print, warn_print): use rb_write_error_str() instead of writing to rb_stderr directly. * io.c (rb_write_error_str): a stopgap measure not to unblock GVL. warning from require seems to still have race condition errors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-18* vm.c (rb_vm_jump_tag_but_local_jump): remove unnessesary 2ndnagachika
argument. * load.c (rb_load_internal): ditto. * eval_intern.h (rb_vm_jump_tag_but_local_jump): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01adjust style.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-12* probes.d: add DTrace probe declarations. [ruby-core:27448]tenderlove
* array.c (empty_ary_alloc, ary_new): added array create DTrace probe. * compile.c (rb_insns_name): allowing DTrace probes to access instruction sequence name. * Makefile.in: translate probes.d file to appropriate header file. * common.mk: declare dependencies on the DTrace header. * configure.in: add a test for existence of DTrace. * eval.c (setup_exception): add a probe for when an exception is raised. * gc.c: Add DTrace probes for mark begin and end, and sweep begin and end. * hash.c (empty_hash_alloc): Add a probe for hash allocation. * insns.def: Add probes for function entry and return. * internal.h: function declaration for compile.c change. * load.c (rb_f_load): add probes for `load` entry and exit, require entry and exit, and wrapping search_required for load path search. * object.c (rb_obj_alloc): added a probe for general object creation. * parse.y (yycompile0): added a probe around parse and compile phase. * string.c (empty_str_alloc, str_new): DTrace probes for string allocation. * test/dtrace/*: tests for DTrace probes. * vm.c (vm_invoke_proc): add probes for function return on exception raise, hash create, and instruction sequence execution. * vm_core.h: add probe declarations for function entry and exit. * vm_dump.c: add probes header file. * vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on function entry and return. * vm_exec.c: expose instruction number to instruction name function. * vm_insnshelper.c: add function entry and exit probes for cfunc methods. * vm_insnhelper.h: vm usage information is always collected, so uncomment the functions. 12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org> * configure.in (isinf, isnan): isinf() and isnan() are macros on DragonFly which cannot be found by AC_REPLACE_FUNCS(). This workaround enforces the fact that they exist on DragonFly. 12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org> * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo), vm_insnhelper.c (vm_search_method): revert r37616 because it's too slow. [ruby-dev:46477] * test/ruby/test_refinement.rb (test_inline_method_cache): skip the test until the bug is fixed efficiently. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06Fix typos in commentsshirosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05Fix compatibility of cached expanded load pathshirosaki
* file.c (rb_get_path_check_to_string): extract from rb_get_path_check(). We change the spec not to call to_path of String object. * file.c (rb_get_path_check_convert): extract from rb_get_path_check(). * file.c (rb_get_path_check): follow the above change. * file.c (rb_file_expand_path_fast): remove check_expand_path_args(). Instead we call it in load.c. * 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. * internal.h (rb_get_path_check_to_string, rb_get_path_check_convert): add declarations. * load.c (rb_construct_expanded_load_path): fix for compatibility. Same checks in rb_get_path_check() are added. We don't replace $LOAD_PATH and ensure that String object of $LOAD_PATH are frozen. We don't freeze non String object and expand it every times. We add arguments for expanding load path partially and checking if load path have relative paths or non String objects. * load.c (load_path_getcwd): get current working directory for checking if it's changed when getting load path. * load.c (rb_get_expanded_load_path): fix for rebuilding cache properly. We check if current working directory is changed and rebuild expanded load path cache. We expand paths which start with ~ (User HOME) and non String objects every times for compatibility. We make this accessible from other source files. * 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): initialize vm->load_path_check_cache. * vm.c (rb_vm_mark): mark vm->load_path_check_cache for GC. * vm_core.h (rb_vm_struct): add vm->load_path_check_cache to store data to check load path cache validity. * test/ruby/test_require.rb (TestRequire): add tests for require compatibility related to cached expanded load path. [ruby-core:47970] [Bug #7158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05Cache the expanded load pathshirosaki
* 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. Patch by Greg Price. [ruby-core:47970] [Bug #7158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05Index $LOADED_FEATURES so that require isn't so slowshirosaki
* 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. Patch by Greg Price. [ruby-core:47970] [Bug #7158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05Expose whether two arrays are sharedshirosaki
* 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. Patch by Greg Price. [ruby-core:47970] [Bug #7158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05Clarify and explain loaded_feature_path and rb_feature_pshirosaki
* 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. Patch by Greg Price. [ruby-core:47970] [Bug #7158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-29load.c: adjust stylenobu
* load.c (loaded_feature_path): adjust style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-24Improve require/File.expand_path performance on Windowsluislavena
* configure.in (mingw): add shlwapi to the list of dependency libs for Windows. * win32/Makefile.sub (EXTSOLIBS): ditto. * internal.h: declare internal functions rb_w32_init_file, rb_file_expand_path_internal and rb_file_expand_path_fast. * file.c (Init_File): invoke Windows initialization rb_w32_init_file * win32/file.c (rb_file_load_path_internal): new function. Windows-specific implementation that replaces file_expand_path. [Bug #6836][ruby-core:46996] * win32/file.c (rb_w32_init_file): new function. Initialize codepage cache for faster conversion encodings lookup. * file.c (file_expand_path): rename to rb_file_expand_path_internal. Conditionally exclude from Windows. * file.c (rb_file_expand_path_fast): new function. delegates to rb_file_expand_path_internal without performing a hit to the filesystem. * file.c (file_expand_path_1): use rb_file_expand_path_internal without path expansion (used by require). * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * load.c (rb_get_expanded_load_path): use rb_file_expand_path_fast. * load.c (rb_feature_provided): ditto. * file.c (rb_file_expand_path): use rb_file_expand_path_internal with path expansion. * file.c (rb_file_absolute_path): ditto. * test/ruby/test_file_exhaustive.rb: new tests to exercise rb_file_expand_path_internal implementation and compliance with existing behaviors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-23load.c: keep encoding of feature namenobu
* file.c (rb_find_file_ext_safe, rb_find_file_safe): default to US-ASCII for encdb and transdb. * load.c (search_required): keep encoding of feature name. set loading path to filesystem encoding. [Bug #6377][ruby-core:44750] * ruby.c (add_modules, require_libraries): assume default external encoding as well as ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-05ThreadShieldnobu
* thread.c (ThreadShield): rename from Barrier. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e