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

1472 Коммитов

Автор SHA1 Сообщение Дата
Lourens Naudé a47f598d77
Reduce ONIG_NREGION from 10 to 4: power of 2 and testing revealed most pattern matches are less than or equal to 4 results
Closes: https://github.com/ruby/ruby/pull/2135
2019-05-07 21:58:55 +09:00
Lourens Naudé cf930985da Remove member char_offset_updated from struct rmatch as member char_offset_num_allocated can serve the same purpose as that predicate 2019-04-24 02:02:05 +09:00
Lourens Naudé 31cf13060c Only define history_root member of the Oniguruma re_registers struct if USE_CAPTURE_HISTORY is enabled 2019-04-24 00:40:17 +09:00
SHIBATA Hiroshi 184447d91c
ViewVC of svn.ruby-lang.org was shutdown status. 2019-04-22 19:37:22 +09:00
naruse d3df725f9e Make rb_hash_bulk_insert public
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21 05:37:11 +00:00
tenderlove 91793b8967 Add `GC.compact` again.
🙏

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20 01:19:47 +00:00
tenderlove 744e5df715 Reverting compaction for now
For some reason symbols (or classes) are being overridden in trunk

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 09:41:41 +00:00
ktsj 9738f96fcf Introduce pattern matching [EXPERIMENTAL]
[ruby-core:87945] [Feature #14912]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 06:48:03 +00:00
tenderlove 3c55b643ae Adding `GC.compact` and compacting GC support.
This commit adds the new method `GC.compact` and compacting GC support.
Please see this issue for caveats:

  https://bugs.ruby-lang.org/issues/15626

[Feature #15626]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 03:17:25 +00:00
svn 481481b81a * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10 09:16:00 +00:00
kazu 25c1fd3b90 Reverting all commits from r67479 to r67496 because of CI failures
Because hard to specify commits related to r67479 only.
So please commit again.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10 09:15:21 +00:00
tenderlove 73f891f1a5 fix RMoved definition location
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09 23:23:39 +00:00
tenderlove 3ef4db15e9 Adding `GC.compact` and compacting GC support.
This commit adds the new method `GC.compact` and compacting GC support.
Please see this issue for caveats:

  https://bugs.ruby-lang.org/issues/15626

[Feature #15626]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09 20:32:04 +00:00
mrkn 7570864267 Introduce RVALUE_EMBED_LEN_MAX to remove a magic number
* include/ruby/ruby.h: replace a magic number with RVALUE_EMBED_LEN_MAX,
  which indicates the number of VALUE elements can be embedded in a RVALUE.

* internal.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-14 15:29:04 +00:00
normal 23444302d9 introduce rb_nogvl C-API to mark ubf as async-signal-safe
zlib and bignum both contain unblocking functions which are
async-signal-safe and do not require spawning additional
threads.

We can execute those functions directly in signal handlers
without incurring overhead of extra threads, so provide C-API
users the ability to deal with that.  Other C-API users may
have similar need.

This flexible API can supercede existing uses of
rb_thread_call_without_gvl and rb_thread_call_without_gvl2 by
introducing a flags argument to control behavior.

Note: this API is NOT finalized.  It needs approval from other
committers.  I prefer shorter name than previous
rb_thread_call_without_gvl* functions because my eyes requires
big fonts.

[Bug #15499]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 13:14:11 +00:00
matz 3a0471faa0 version.h (RUBY_VERSION): 2.7.0 development has started.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-25 13:45:17 +00:00
ko1 a976acd603 remove "deprecated" for rb_frame_method_id_and_class [Bug #15300]
* include/ruby/backward.h (rb_frame_method_id_and_class): we had labeled
  `rb_frame_method_id_and_class()` as deprecated because MRI internal
  doesn't use it, but we found there are user of this API in external
  C-extensions. Now we don't have proper alternative API and no time
  to make alternative API, so I remove "deprecated" label.
  [Bug #15300]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-24 02:02:47 +00:00
nobu c6ef5bc31e complex.c: new APIs for Complex
[Feature #15066]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 11:06:48 +00:00
nobu dc8afd385d complex.c: rb_complex_new_polar
* complex.c (rb_complex_new_polar): renamed with _new to clarify
  that it creates a new instance, but is not an instance method.

* complex.c (rb_complex_polar): deprecated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 11:06:47 +00:00
mrkn 31eb48a0ac enumerator.c: Add rb_arithmetic_sequence_components_t
Add rb_arithmetic_sequence_components_t struct for encapsulating
the components of ArithmeticSequence.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 07:16:07 +00:00
mrkn 914a290324 enumerator.c: rb_arithmetic_sequence_extract
New public C-API for extracting components of Enumerator::ArithmeticSequence
or Range.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 06:39:58 +00:00
naruse 7405bbda27 Define HAVE_STMT_AND_DECL_IN_EXPR and use it [Bug #15293]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-10 13:58:36 +00:00
ko1 5ac990e83e `script_compiled` TracePoint event [Feature #15287]
* vm_trace.c: add `script_compiled` event. This event invoked
  after script compiling and before evaluating compiled script.
  Also the following methods are added:

  `TracePoint#compiled_instruction_sequence` method to get compiled
  `RubyVM::InstructionSequence` instance.

  `TracePoint#compiled_eval_script` method to get compiled script (String)
  by *eval methods (return nil if compiling by file).

* vm_trace.c (tracepoint_attr_raised_exception):


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06 13:42:32 +00:00
naruse 8b14bd4e14 Should be true fix for r66200
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06 12:35:00 +00:00
naruse 956d35e2d0 refix of r66200
Though internal.h has the prototype, it still shows symbol lookup error...
https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20181206T050002Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06 10:02:04 +00:00
ko1 eb79191f16 Introduce "COLDFUNC" function attribute.
* include/ruby/defines.h: introduce "COLDFUNC" function attribute
  on several compilers for called unlikely functions.
  Apply to rb_memerror, rb_warn and rb_bug.

  A patch form  methodmissing <lourens@bearmetal.eu>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05 17:23:32 +00:00
ko1 5e11de6585 make `RARRAY_PTR_USE` more conservertive.
* include/ruby/ruby.h: de-transient at
  `RARRAY_PTR_USE` and `RARRAY_PTR_USE_START`.
  Introduce `RARRAY_PTR_USE_TRANSIENT` and
  `RARRAY_PTR_USE_START_TRANSIENT` if you don't want to
  de-transient an array. Generally, it is difficult
  so C-extension writers should not use them.

* array.c: use `RARRAY_PTR_USE_TRANSIENT` if possible.

* hash.c: ditto.

* enum.c (enum_sort_by): remove `rb_ary_transient_heap_evacuate()`
  because `RARRAY_PTR_USE` do de-transient.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-03 12:36:39 +00:00
odaira 3385395796 errno.h must be included after config.h because config.h might define
_REENTRANT, _THREAD_SAFE, etc., which affect how errno is defined
on some architectures

* ext/openssl/ossl.h: include errno.h after ruby.h

* include/ruby/io.h: include errno.h after ruby/config.h

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-21 20:39:09 +00:00
nobu de790435fa ruby/ruby.h: void rb_scan_args_verify
* include/ruby/ruby.h (rb_scan_args_verify): void the never used
  result.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-19 15:00:35 +00:00
svn 9c8119e78b * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-15 22:28:06 +00:00
normal 51aaf74bba include/ruby/ruby.h (RB_ALLOCV*): remove unnecessary GC guard
text	   data	    bss	    dec	    hex	filename
 3535061	  21232	  72944	3629237	 3760b5	ruby.before
 3534141	  21232	  72944	3628317	 375d1d	ruby.after

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-15 22:28:03 +00:00
svn cc7fcbbc25 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-01 08:53:53 +00:00
ko1 c39797e872 introduce USE_TRANSIENT_HEAP to enable/disable theap.
* include/ruby/ruby.h: intrdocue `USE_TRANSIENT_HEAP` macro
  to enable/disable transient heap.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-01 08:53:44 +00:00
ko1 8f675cdd00 support theap for T_HASH. [Feature #14989]
* hash.c, internal.h: support theap for small Hash.
  Introduce RHASH_ARRAY (li_table) besides st_table and small Hash
  (<=8 entries) are managed by an array data structure.
  This array data can be managed by theap.
  If st_table is needed, then converting array data to st_table data.

  For st_table using code, we prepare "stlike" APIs which accepts hash value
  and are very similar to st_ APIs.

  This work is based on the GSoC achievement
  by tacinight <tacingiht@gmail.com> and refined by ko1.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 22:11:51 +00:00
ko1 312b105d0e introduce TransientHeap. [Bug #14858]
* transient_heap.c, transient_heap.h: implement TransientHeap (theap).
  theap is designed for Ruby's object system. theap is like Eden heap
  on generational GC terminology. theap allocation is very fast because
  it only needs to bump up pointer and deallocation is also fast because
  we don't do anything. However we need to evacuate (Copy GC terminology)
  if theap memory is long-lived. Evacuation logic is needed for each type.

  See [Bug #14858] for details.

* array.c: Now, theap for T_ARRAY is supported.

  ary_heap_alloc() tries to allocate memory area from theap. If this trial
  sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on.
  We don't need to free theap ptr.

* ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that
  if ary is allocated at theap, force evacuation to malloc'ed memory.
  It makes programs slow, but very compatible with current code because
  theap memory can be evacuated (theap memory will be recycled).

  If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT()
  instead of RARRAY_CONST_PTR(). If you can't understand when evacuation
  will occur, use RARRAY_CONST_PTR().

(re-commit of r65444)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 21:53:56 +00:00
ko1 7d359f9b69 revert r65444 and r65446 because of commit miss
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 21:01:55 +00:00
ko1 90ac549fa6 introduce TransientHeap. [Bug #14858]
* transient_heap.c, transient_heap.h: implement TransientHeap (theap).
  theap is designed for Ruby's object system. theap is like Eden heap
  on generational GC terminology. theap allocation is very fast because
  it only needs to bump up pointer and deallocation is also fast because
  we don't do anything. However we need to evacuate (Copy GC terminology)
  if theap memory is long-lived. Evacuation logic is needed for each type.

  See [Bug #14858] for details.

* array.c: Now, theap for T_ARRAY is supported.

  ary_heap_alloc() tries to allocate memory area from theap. If this trial
  sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on.
  We don't need to free theap ptr.

* ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that
  if ary is allocated at theap, force evacuation to malloc'ed memory.
  It makes programs slow, but very compatible with current code because
  theap memory can be evacuated (theap memory will be recycled).

  If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT()
  instead of RARRAY_CONST_PTR(). If you can't understand when evacuation
  will occur, use RARRAY_CONST_PTR().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 20:46:24 +00:00
normal b67d76b3a6 Revert "vm_trace: implement postponed_jobs as st_table"
This reverts commit 5a1dfb04bc (r63451)

And mark the functions as async-signal-safe while we're at it to
prevent future developers from making the same mistake as I did :x

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-23 03:47:45 +00:00
nobu f2427a436f Define PRIdPTR etc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-13 16:21:07 +00:00
svn 6938834c08 * remove trailing space. [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-08 13:57:38 +00:00
k0kubun 71e70d2802 include/ruby/ruby.h: comment about mswin RUBY_EXTERN [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-08 13:57:36 +00:00
k0kubun ad2d2e3f0f include/ruby/ruby.h: import external symbols
properly on MinGW MJIT.

test_jit.rb: all MJIT tests are now passing on MinGW.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-08 13:46:42 +00:00
k0kubun fd719c59e9 include/ruby/intern.h: don't modify MJIT_FUNC_EXPORTED
on most of platforms except mswin.

Changing it to static was needed for mswin because it doesn't use
transform_mjit_header, but for platforms that use it, it causes link
error like:

/usr/bin/ld: /tmp/_ruby_mjit_p21652u0.o: relocation R_X86_64_PC32 against undefined symbol `rb_vm_search_method_slowpath' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

include/ruby/defines.h: MJIT_FUNC_EXPORTED moved to intern.h

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-07 14:00:04 +00:00
k0kubun d590027fd2 vm_core.h: fix inconsistent prototype declarations
like "error: static declaration of 'xxx' follows non-static declaration".
r64940 is successfully built on mswin but not built on almost all other environments.

internal.h: ditto

include/ruby/intern.h: MJIT_STATIC is moved to this file since this file
also needs to use this.

mjit.h: MJIT_STATIC is moved from this.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-07 13:34:59 +00:00
shyouhei bc2d493e0d use configure-defined macro instead of __GNUC__
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-26 06:16:32 +00:00
nobu c46515e42a backward.h: removed stale declarations
* include/ruby/backward.h (rb_complex_set_real, rb_complex_set_imag):
  removed useless declarations which have been deprecated from the
  beginning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-05 20:02:32 +00:00
nobu 868ad2104c ruby.h: removed internal macros
* include/ruby/ruby.h (RCOMPLEX_SET_REAL, RCOMPLEX_SET_IMAG): removed
  macros for internal use, which have been exposed by accident.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-04 12:30:34 +00:00
nobu 1cf2bb4b20 use mingw ANSI stdio
[Bug #13496]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-04 08:39:14 +00:00
nobu c115b39e03 Declare as gnu_printf on mingw
[Bug #13496]

From: MSP-Greg <MSP-Greg@users.noreply.github.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-03 08:20:41 +00:00
nobu 762f44cf49 configure.ac: printf prifix for int64_t
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-27 05:39:09 +00:00