summaryrefslogtreecommitdiff
path: root/internal.h
AgeCommit message (Collapse)Author
2014-01-29merge revision(s) 39594,39596: [Backport #8010]usa
* enumerator.c (enumerator_with_index_i): allow Bignum as offset, to get rid of conversion exception and integer overflow. [ruby-dev:47131] [Bug #8010] * enumerator.c (enumerator_with_index): Restore handling of a nil memo from r39594. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02merge revision(s) 42212,42214: [Backport #8669]usa
* string.c: add internal API rb_str_locktmp_ensure(). * io.c (io_fread): use rb_str_locktmp_ensure(). [ruby-core:56121] [Bug #8669] * test/ruby/test_io.rb: add a test for above. * io.c (io_getpartial): use rb_str_locktmp_ensure(). [ruby-core:56121] [Bug #8669] * io.c (rb_io_sysread): ditto. * test/ruby/test_io.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@42327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25merge revision(s) ↵usa
34849,34853,34854,34855,34859,34862,35384,35385,36811,36812,36850,36907,36908: [Backport #7174] * Makefile.in (PLATFORM_DIR): add a variable for `win32` directory. * Makefile.in (clean-platform): add new target. It cleans `win32` directory. * common.mk (clean): add a dependency for `win32` directory. * common.mk (distclean): ditto. * common.mk (distclean-platform): add new target. It cleans `win32` directory. * common.mk ($(PLATFORM_D)): add new target to make `win32` directory. * common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32` directory. * common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c. * configure.in: move win32.o into `win32` directory and add win32/file.o to MISSING. * file.c (file_load_ok, rb_file_load_ok): replace static file_load_ok() with public rb_file_load_ok(). It's to link Windows implementation in win32/file.c. * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * win32/file.c (rb_file_load_ok): new file. Add Windows specific optimized implementation of rb_file_load_ok(). We created a separated file to avoid too many #ifdef macro which is unreadable. * win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32` directory. * win32/Makefile.sub (MISSING): move win32.obj into `win32` directory and add win32/file.obj to MISSING. * win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY. It's because miniruby doesn't exist when making `win32` directory. * win32/Makefile.sub (clean-platform): add new target to clean `win32` directory. * win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match win32/file.c to build properly. * win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into `win32` directory. Patch created with Luis Lavena. [ruby-core:42480] [Feature #5999] * win32/Makefile.sub (MAKEDIRS): use mkdir of cmd.exe instead of ruby. [Bug #6103] [ruby-core:43012] * win32/README.win32: added a notice about command extension of cmd.exe. * win32/makedirs.bat: new command to make intermediate directories, and not to report any errors if the directory already exists. * win32/Makefile.sub (MAKEDIRS): enable command extensions. * win32/file.c (INVALID_FILE_ATTRIBUTES): define for old SDK. * 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. * test/ruby/test_file_exhaustive.rb: fix test introduced in r36811 for posix environments where HOME is not defined. [ruby-core:47322] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30merge revision(s) 35013:naruse
* numeric.c: fix flodivmod for cornercases [Bug #6044] add ruby_float_mod * insns.def (opt_mod): use ruby_float_mod * internal.h: declare ruby_float_mod * test/ruby/test_float.rb: tests for above * test/ruby/envutil.rb: create helper assert_is_minus_zero git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15merge revision(s) 34629,34630:naruse
* cont.c (rb_fiber_reset_root_local_storage): add a new function to 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. when the fiber was destroyed. [ruby-core:41456] [Bug #5700] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10* internal.h: add comments (cautions).ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10* internal.h (rb_thread_call_with_gvl, rb_thread_call_without_gvl):ko1
make them visible as experimental C APIs. fixes Feature #4328. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09 * internal.h: rb_rational_reciprocal is defined in rational.c.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09 * internal.h: added declarations.tadf
* complex.c: followed the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-30* ext/objspace/objspace.c (ObjectSpace.count_tdata_objects):ko1
Fix rdoc. * ext/objspace/objspace.c (ObjectSpace.count_tdata_objects): Change key type if the klass of a object is zero (internal object). Read rdoc for details. * internal.h: export rb_objspace_data_type_name(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-28* error.c (rb_async_bug_errno): async-safe bug report function.ko1
In timer thread, signal handler shoul use it. The patch is contributed by Eric Wong <normalperson@yhbt.net>. Refs: [ruby-core:37644] and [ruby-core:37647] * thread_pthread.c: use rb_async_bug_errno(). And replace all fprintf() to write(). * internal.h (rb_async_bug_errno): add decl. of above func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21* internal.h: move rb_thread_io_blocking_region() declarationkosaki
from intern.h to internal.h. It's still experimental API and need more discussion. [ruby-dev:43698] * include/ruby/intern.h: ditto. * ext/socket/rubysocket.h: include internal.h. * ext/socket/depend: add internal.h dependency. * ext/socket/extconf.rb: add $INCFLAGS to topdir. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21revert r32183kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21* internal.h: move rb_thread_io_blocking_region() declarationkosaki
from intern.h to internal.h. It's still experimental API and need more discussion. * include/ruby/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don'takr
declare internal functions. * internal.h, vm_core.h: declare internal functions. * array.c: include internal.h. * common.mk: update dependency for array.o. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* internal.h: declarations declared in include/ruby/*.h removed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* method.h, internal.h iseq.h: declare internal functions.akr
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c, thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't declare internal functions. Note that rb_method_entry_eq() is defined in vm_method.c but there was a declaration in proc.c with different const-ness. Now it is declared in method.h with same const-ness to the definition. * object.c (rb_mod_module_exec): don't declare functions declared in include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* include/ruby/backward/classext.h: for evil gems. fixed #4803nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* internal.h: declare more internal functions.akr
* iseq.h (rb_method_get_iseq): declared. * compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c, ruby.c, time.c, util.c, vm.c: don't declare internal functions. * eval.c, parse.y, thread_pthread.c: non-existing function declarations removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09* io.c: fix IO.copy_stream interrupt handling.akr
based on the patch by Eric Wong. [ruby-core:36156] * vm_core.h (rb_thread_call_with_gvl): don't declare here. * thread.c: include internal.h. (rb_thread_execute_interrupts): new function. * internal.h (rb_thread_execute_interrupts): declared. (rb_thread_call_with_gvl): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09* gc.c (rb_objspace_call_finalizer): use rb_typeddata_is_kind_of() fornagachika
type check to get rid of a double free when main Thread has singleton class. [ruby-core:36741] [Bug #4828] * thread.c (rb_obj_is_mutex): add a new utility function. * vm.c (rb_obj_is_thread): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-29* numeric.c (flo_round): fix for negative value.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18* internal.h: add for internal use only.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e