aboutsummaryrefslogtreecommitdiffstats
path: root/ext/-test-
Commit message (Collapse)AuthorAgeFilesLines
* ext/-test-/cxxanyargs: add #pragma for icc.卜部昌平2020-04-101-0/+3
|
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-0851-13/+14295
| | | Split ruby.h
* Clear all trace events during teardownAlan Wu2020-03-291-0/+8
| | | | | | | | | | | Since 0c2d81dada, not all trace events are cleared during VM teardown. This causes a crash when there is a tracepoint for `RUBY_INTERNAL_EVENT_GC_EXIT` active during teardown. The commit looks like a refactoring commit so I think this change was unintentional. [Bug #16682]
* The last argument of rb_rescue2() should always be (VALUE)0Benoit Daloze2020-03-281-4/+4
| | | | | * Otherwise it might segfault, since C has no idea of the type of varargs, and the C code must assume all varargs are VALUE.
* ext/-test-/cxxanyargs: use try_link instead卜部昌平2020-02-251-1/+1
| | | | | We would like to skip this extension library when libstdc++ is missing. To avoid such situation let's use try_link instead of try_compile.
* ext/-test-/cxxanyargs: prevent have_devel check卜部昌平2020-02-201-2/+11
| | | | | | | The `cxx.try_compile` command in this file kicks `cxx.have_devel?` internally, which recursively calls `cxx.try_link` with a different source code. We don't want that happen (the source code compiled in this file must be the first one). We need to fake the system.
* more on NULL versus functions.卜部昌平2020-02-071-1/+1
| | | | | | Function pointers are not void*. See also ce4ea956d24eab5089a143bba38126f2b11b55b6 8427fca49bd85205f5a8766292dd893f003c0e48
* Fix linkage of popen_deadlock testMikhail Novosyolov2020-02-041-0/+1
| | | | | | | | DEBUG: BUILDSTDERR: /usr/bin/ld: infinite_loop_dlsym.o: in function `native_loop_dlsym': DEBUG: BUILDSTDERR: /builddir/build/BUILD/ruby-2.7.0/ext/-test-/popen_deadlock/infinite_loop_dlsym.c:16: undefined reference to `dlsym' DEBUG: BUILDSTDERR: collect2: error: ld returned 1 exit status Ruby was built with LibreSSL.
* fix delete unnecessary return卜部昌平2020-02-011-1/+1
| | | | Was my mistake to put return here.
* support C++ std::nullptr_t卜部昌平2020-01-311-0/+122
| | | | | | | C++ keyword `nullptr` represents a null pointer (note also that NULL is an integer in C++ due to its design flaw). Its type is `std::nullptr_t`, defined in <cstddef> standard header. Why not support it when the backend implementation can take a null pointer as an argument.
* Return the makefile contentNobuyoshi Nakada2020-01-311-0/+1
| | | | | Block for `create_makefile` is expected to return the content of the makefile.
* Move .IGNORE in extconf.rbNARUSE, Yui2020-01-312-3/+1
|
* Support nmakeNARUSE, Yui2020-01-311-0/+2
|
* Ignore expected errors on compiling C++ source [Bug #16331]NARUSE, Yui2020-01-311-0/+1
| | | | | | | | | | | | | | BSD make can run parallel more aggressively than GNU make. It communicate with other make process through -J option in MAKEFLAGS environment variable to notify a build failure happend in an other pararell make process. https://www.freebsd.org/cgi/man.cgi?make It usually works well but ext/-test-/cxxanyargs/Makefile has two targets which are expected to fail (failure.o and failurem1.o). Additional note: To test and debug this issue, following command will speed up it. `make -f exts.mk -j8 clean all`
* fix rb_define_global_function to take const VALUE*卜部昌平2020-01-281-0/+70
| | | | | It was unable for rb_define_global_function to take VALUE(*)(int argc, const VLAUE *argv, VALUE self) -style function. Test added.
* add test for rb_define_global_function卜部昌平2020-01-281-0/+58
| | | | was missing.
* add test for rb_define_method_id卜部昌平2020-01-281-0/+56
| | | | was missing.
* improved support for rb_f_notimplement卜部昌平2020-01-281-0/+30
| | | | | | rb_f_notimplement should be accepted for all possible arities. Test provided for that.
* Update dependenciesNobuyoshi Nakada2020-01-171-0/+1
| | | | | internal/rational.h needs internal/warnings.h with Apple clang, for `UNALIGNED_MEMBER_ACCESS`.
* Update dependencies in makefiles againKazuhiro NISHIYAMA2020-01-171-0/+9
| | | | patch from https://travis-ci.org/ruby/ruby/jobs/638231960
* rb_rational_raw: make a denominator always positiveKenta Murata2020-01-171-0/+8
|
* Update dependencies in makefilesKazuhiro NISHIYAMA2020-01-171-0/+2
| | | | patch from https://travis-ci.org/ruby/ruby/jobs/638226493
* Fully separate positional arguments and keyword argumentsJeremy Evans2020-01-021-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | This removes the warnings added in 2.7, and changes the behavior so that a final positional hash is not treated as keywords or vice-versa. To handle the arg_setup_block splat case correctly with keyword arguments, we need to check if we are taking a keyword hash. That case didn't have a test, but it affects real-world code, so add a test for it. This removes rb_empty_keyword_given_p() and related code, as that is not needed in Ruby 3. The empty keyword case is the same as the no keyword case in Ruby 3. This changes rb_scan_args to implement keyword argument separation for C functions when the : character is used. For backwards compatibility, it returns a duped hash. This is a bad idea for performance, but not duping the hash breaks at least Enumerator::ArithmeticSequence#inspect. Instead of having RB_PASS_CALLED_KEYWORDS be a number, simplify the code by just making it be rb_keyword_given_p().
* update dependencies卜部昌平2019-12-265-0/+40
|
* decouple internal.h headers卜部昌平2019-12-2612-13/+13
| | | | | | | | | | | | | | | | | | Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies).
* check interrupts at each frame pop timing.Koichi Sasada2019-11-291-1/+17
| | | | | | | | | | | | | | | | | | Asynchronous events such as signal trap, finalization timing, thread switching and so on are managed by "interrupt_flag". Ruby's threads check this flag periodically and if a thread does not check this flag, above events doesn't happen. This checking is CHECK_INTS() (related) macro and it is placed at some places (laeve instruction and so on). However, at the end of C methods, C blocks (IMEMO_IFUNC) etc there are no checking and it can introduce uninterruptible thread. To modify this situation, we decide to place CHECK_INTS() at vm_pop_frame(). It increases interrupt checking points. [Bug #16366] This patch can introduce unexpected events...
* Check -1 arity for C++Nobuyoshi Nakada2019-11-223-5/+23
|
* Revert the line for nextafter.c for FreeBSD makeNobuyoshi Nakada2019-11-201-0/+3
|
* Update dependenciesNobuyoshi Nakada2019-11-188-60/+59
|
* Remove unneeded exec bits from some filesDavid Rodríguez2019-11-093-0/+0
| | | | | | | | | | | | | I noticed that some files in rubygems were executable, and I could think of no reason why they should be. In general, I think ruby files should never have the executable bit set unless they include a shebang, so I run the following command over the whole repo: ```bash find . -name '*.rb' -type f -executable -exec bash -c 'grep -L "^#!" $1 || chmod -x $1' _ {} \; ```
* Moved RB_METHOD_DEFINITION_DECL to intern.hNobuyoshi Nakada2019-10-121-0/+204
| | | | This macro is used here before defined in ruby.h.
* atime may not updated unless strictatime is set on macOS CatalinaNobuyoshi Nakada2019-10-121-0/+3
| | | | | | | | | | | | | Cited from mount(8): ``` strictatime Always update the file access time when reading from a file. Without this option the filesystem may default to a less strict update mode, where some access time updates are skipped for performance reasons. This option could be ignored if it is not supported by the filesystem. ```
* ext/-test-/enumerator_kw/enumerator_kw.c: remove unused variableYusuke Endoh2019-10-011-1/+1
|
* Add rb_enumeratorize_with_size_kw and related macrosJeremy Evans2019-09-303-0/+36
| | | | | | | | | | Currently, there is not a way to create a sized enumerator in C with a different set of arguments than provided by Ruby, and correctly handle keyword arguments. This function allows that. The need for this is fairly uncommon, but it occurs at least in Enumerator.produce, which takes arugments from Ruby but calls rb_enumeratorize_with_size with a different set of arguments.
* Add three more C-API functions for handling keywordsJeremy Evans2019-09-291-2/+30
| | | | | | | | This adds rb_funcall_passing_block_kw, rb_funcallv_public_kw, and rb_yield_splat_kw. This functions are necessary to easily handle cases where rb_funcall_passing_block, rb_funcallv_public, and rb_yield_splat are currently used and a keyword argument separation warning is raised.
* Fix more keyword separation issuesJeremy Evans2019-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | This fixes instance_exec and similar methods. It also fixes Enumerator::Yielder#yield, rb_yield_block, and a couple of cases with Proc#{<<,>>}. This support requires the addition of rb_yield_values_kw, similar to rb_yield_values2, for passing the keyword flag. Unlike earlier attempts at this, this does not modify the rb_block_call_func type or add a separate function type. The functions of type rb_block_call_func are called by Ruby with a separate VM frame, and we can get the keyword flag information from the VM frame flags, so it doesn't need to be passed as a function argument. These changes require the following VM functions accept a keyword flag: * vm_yield_with_cref * vm_yield * vm_yield_with_block
* Make rb_scan_args handle keywords more similar to Ruby methods (#2460)Jeremy Evans2019-09-251-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cfuncs that use rb_scan_args with the : entry suffer similar keyword argument separation issues that Ruby methods suffer if the cfuncs accept optional or variable arguments. This makes the following changes to : handling. * Treats as **kw, prompting keyword argument separation warnings if called with a positional hash. * Do not look for an option hash if empty keywords are provided. For backwards compatibility, treat an empty keyword splat as a empty mandatory positional hash argument, but emit a a warning, as this behavior will be removed in Ruby 3. The argument number check needs to be moved lower so it can correctly handle an empty positional argument being added. * If the last argument is nil and it is necessary to treat it as an option hash in order to make sure all arguments are processed, continue to treat the last argument as the option hash. Emit a warning in this case, as this behavior will be removed in Ruby 3. * If splitting the keyword hash into two hashes, issue a warning, as we will not be splitting hashes in Ruby 3. * If the keyword argument is required to fill a mandatory positional argument, continue to do so, but emit a warning as this behavior will be going away in Ruby 3. * If keyword arguments are provided and the last argument is not a hash, that indicates something wrong. This can happen if a cfunc is calling rb_scan_args multiple times, and providing arguments that were not passed to it from Ruby. Callers need to switch to the new rb_scan_args_kw function, which allows passing of whether keywords were provided. This commit fixes all warnings caused by the changes above. It switches some function calls to *_kw versions with appropriate kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS is used. If creating new arguments, RB_PASS_KEYWORDS is used if the last argument is a hash to be treated as keywords. In open_key_args in io.c, use rb_scan_args_kw. In this case, the arguments provided come from another C function, not Ruby. The last argument may or may not be a hash, so we can't set keyword argument mode. However, if it is a hash, we don't want to warn when treating it as keywords. In Ruby files, make sure to appropriately use keyword splats or literal keywords when calling Cfuncs that now issue keyword argument separation warnings through rb_scan_args. Also, make sure not to pass nil in place of an option hash. Work around Kernel#warn warnings due to problems in the Rubygems override of the method. There is an open pull request to fix these issues in Rubygems, but part of the Rubygems tests for their override fail on ruby-head due to rb_scan_args not recognizing empty keyword splats, which this commit fixes. Implementation wise, adding rb_scan_args_kw is kind of a pain, because rb_scan_args takes a variable number of arguments. In order to not duplicate all the code, the function internals need to be split into two functions taking a va_list, and to avoid passing in a ton of arguments, a single struct argument is used to handle the variables previously local to the function.
* Fix for explicit cast without RUBY_METHOD_FUNCNobuyoshi Nakada2019-09-201-0/+7
|
* Check various method defitions in C++Nobuyoshi Nakada2019-09-201-0/+44
|
* Get rid of embedding make command lineNobuyoshi Nakada2019-09-201-2/+3
| | | | | NMAKE sets MAKE to the full path name, which includes spaces by the default installation.
* Fixed cxxanyargs/dependNobuyoshi Nakada2019-09-201-4/+4
| | | | | * Removed excess backslashes * Fixed the target name to try failure.cpp
* Moved unmatch arity check to depend fileNobuyoshi Nakada2019-09-192-12/+9
| | | | To substitute suffixes and VPATH for nmake.
* Ensure that unmatched arity fails in C++Nobuyoshi Nakada2019-09-192-1/+27
|
* Removed mkmf.log dump in MakefileNobuyoshi Nakada2019-09-191-5/+0
|
* DEBUG: cxxanyargsNobuyoshi Nakada2019-09-191-0/+3
|
* DEBUG: cxxanyargsNobuyoshi Nakada2019-09-192-1/+2
|
* DEBUGNobuyoshi Nakada2019-09-191-0/+1
|
* Look up the language moduleNobuyoshi Nakada2019-09-191-1/+1
| | | | | | Look up language module with `MakeMakefile.[]`, insted of a accessing constant under that module directly, to get rid of expose the constant to the toplevel inadvertently.
* Removed unused keyword argument [ci skip]Nobuyoshi Nakada2019-09-191-1/+1
|
* [EXPERIMENTAL] MakeMakefile::CXX for C++Nobuyoshi Nakada2019-09-181-20/+5
|