summaryrefslogtreecommitdiff
path: root/string.c
Commit message (Collapse)AuthorAgeFilesLines
* Change termlen when changing encoding during concatenationPeter Zhu2022-01-071-0/+1
| | | | After changing the encoding, we should update the terminator length.
* [DOC] Fix typos in a doxygen comment [ci skip]Nobuyoshi Nakada2022-01-071-1/+1
|
* Revert "Set encoding before concatenating to string"Peter Zhu2022-01-061-1/+1
| | | | This reverts commit 44368b5f8bc21e19fa06a0fc0625923fc41293e6.
* Set correct termlen for frozen stringsPeter Zhu2022-01-061-2/+3
| | | | | Frozen strings should have the same termlen as the original string when copy_encoding is true.
* Set encoding before concatenating to stringPeter Zhu2022-01-061-1/+1
| | | | | If we set encoding after the call to rb_str_buf_cat, then rb_str_buf_cat will not set the correct terminator length.
* Remove tainted and trusted featuresNobuyoshi Nakada2021-12-261-15/+0
| | | | Already these had been announced to be removed in 3.2.
* [DOC] How to get the longest last match [Bug #18415]Nobuyoshi Nakada2021-12-191-1/+31
|
* What's Here for Symbol (#5289)Burdette Lamar2021-12-171-0/+59
| | | | * What's Here for Symbol
* Enhanced RDoc for case mapping (#5245)Burdette Lamar2021-12-171-140/+173
| | | | | | | | | | | | | | | | | | | | | | | Adds file doc/case_mapping.rdoc, which describes case mapping and provides a link target that methods doc can link to. Revises: String#capitalize String#capitalize! String#casecmp String#casecmp? String#downcase String#downcase! String#swapcase String#swapcase! String#upcase String#upcase! Symbol#capitalize Symbol#casecmp Symbol#casecmp? Symbol#downcase Symbol#swapcase Symbol#upcase
* Enhanced RDoc for String (#5234)Burdette Lamar2021-12-101-46/+59
| | | | | | | | | | | Treated: #to_i #to_f #to_s #inspect #dump #undump
* Enhanced RDoc for String (#5227)Burdette Lamar2021-12-081-50/+91
| | | | | | | | | | | | | | Treats: #replace #clear #chr #getbyte #setbyte #byteslice #reverse #reverse! #include?
* Fix link (#5208)Burdette Lamar2021-12-031-1/+1
|
* Adding links to literals and Kernel (#5192)Burdette Lamar2021-12-031-9/+21
| | | | * Adding links to literals and Kernel
* Improve performance of embedded string allocationPeter Zhu2021-11-261-3/+2
| | | | | Non-VWA embedded string allocation had a performance regression. This commit improves performance of non-VWA embedded string allocation.
* Speed up Ractors for Variable Width AllocationPeter Zhu2021-11-231-5/+9
| | | | | | | | | | | | | | | | This commit adds a Ractor cache for every size pool. Previously, all VWA allocated objects used the slowpath and locked the VM. On a micro-benchmark that benchmarks String allocation: VWA turned off: 29.196591 0.889709 30.086300 ( 9.434059) VWA before this commit: 29.279486 41.477869 70.757355 ( 12.527379) VWA after this commit: 16.782903 0.557117 17.340020 ( 4.255603)
* [Feature #18290] Remove all usages of rb_gc_force_recyclePeter Zhu2021-11-081-5/+8
| | | | | This commit removes usages of rb_gc_force_recycle since it is a burden to maintain and makes changes to the GC difficult.
* string.c: Follow up to ae2359f602bb467ca755eef02d73d361d35eaed7Yusuke Endoh2021-11-031-5/+6
| | | | | * Mention `\0` * Make the example of hash replacement meaningful
* Enhanced RDoc for String (#5060)Burdette Lamar2021-11-021-138/+181
| | | | | | | | | | Treated: #slice! #sub #sub! #gsub #gsub!
* Cleanup some RDoc (#5050)Burdette Lamar2021-10-281-23/+106
| | | Mostly adding blank line before and after code segment, to improve compliance with doc\documentation_guide.rdoc.
* string.c: Add some comments about STR flagsYusuke Endoh2021-10-291-3/+7
|
* [Feature #18239] Implement VWA for stringsPeter Zhu2021-10-251-74/+249
| | | | | This commit adds support for embedded strings with variable capacity and uses Variable Width Allocation to allocate strings.
* [Feature #18239] Add struct for embedded stringsPeter Zhu2021-10-251-11/+11
|
* Update documentation for String and Symbol to discuss differencesJeremy Evans2021-10-151-3/+34
| | | | Implements [Feature #14347]
* Add tests for the edge caces of `String#end_with?`Nobuyoshi Nakada2021-10-081-3/+5
| | | | | | Also, check if a suffix is empty, to guarantee the assumption of `onigenc_get_left_adjust_char_head` that `*s` is always accessible, even in the case of `SHARABLE_MIDDLE_SUBSTRING`.
* * remove trailing spaces. [ci skip]git2021-10-061-1/+1
|
* Fix documentation for String#{<<,concat,prepend}Jeremy Evans2021-10-051-9/+10
| | | | | | | These methods mutate and return the receiver, they don't create and return a new string. Fixes [Bug #18241]
* Adjust types to rb_enc_left_char_headNobuyoshi Nakada2021-10-051-5/+4
| | | | I dislike unnatural casts.
* Remove a redundant cast between the exact same typesNobuyoshi Nakada2021-10-051-1/+1
|
* rb_enc_left_char_head(): take void*卜部昌平2021-10-051-1/+1
| | | | Nobu doesn't like (char*) cast.
* downcase_single/upcase_single: assume ASCII卜部昌平2021-10-051-4/+2
| | | | | These functions assume ASCII compatibility. That has to be ensured in their caller.
* include/ruby/encoding.h: convert macros into inline functions卜部昌平2021-10-051-1/+1
| | | | Less macros == huge win.
* add undeclared variables卜部昌平2021-10-051-0/+2
| | | | Why did they even exist?
* Skip broken strings as the locale encodingNobuyoshi Nakada2021-10-011-0/+6
|
* [DOC] Use `unpack1` instead of `unpack(template)[0]` [ci skip]Kazuhiro NISHIYAMA2021-09-231-2/+2
|
* Adjust indent in string.c [ci skip]Nobuyoshi Nakada2021-09-161-1/+1
|
* Refactor and Using RBOOL macroS.H2021-09-151-2/+1
|
* Remove printf family from the mjit headerNobuyoshi Nakada2021-09-111-0/+10
| | | | | Linking printf family functions makes mjit objects to link unnecessary code.
* include/ruby/internal/intern/string.h: add doygen卜部昌平2021-09-101-20/+5
| | | | Must not be a bad idea to improve documents. [ci skip]
* [Bug #18154] Fix memory leak in String#initializePeter Zhu2021-09-081-1/+1
| | | | | String#initialize can leak memory when called on a string that is marked with STR_NOFREE because it does not unset the STR_NOFREE flag.
* Treat NULL fake string as an empty stringNobuyoshi Nakada2021-08-171-0/+5
| | | | And the NULL string must be of size 0.
* Term fill in String#{,l,r}strip! even when SHARABLE_MIDDLE_SUBSTRINGJeremy Evans2021-08-111-6/+0
| | | | | | | | | | | | Each of these methods calls str_modify_keep_cr before term filling, which should ensure the backing string uses private memory, and therefore term filling should not affect other strings. Skipping the term filling was added in a707ab4bc8a29241440f56696098efa2f7f3ff45. Fixes [Bug #12540]
* Fix indentation in string.cPeter Zhu2021-08-031-9/+9
| | | | | 7 spaces were used for 2 levels of indentation. This commit changes it to use 8 spaces.
* Fix documentation of #<=> and #casecmp [ci skip]Troy Chance2021-08-021-4/+4
| | | Descriptions for return values of -1 and 1 were reversed.
* Using RBOOL macroS.H2021-08-021-8/+5
|
* Escape unprintable chars only, without surrounding quotesNobuyoshi Nakada2021-07-241-2/+2
|
* Refactor rb_str_export and rb_str_export_locale function'sS-H-GAMELINKS2021-07-071-2/+2
|
* Specify version to remove as bare numbersNobuyoshi Nakada2021-06-301-2/+2
|
* rb_warn_deprecated_to_remove_at [Feature #17432]Nobuyoshi Nakada2021-06-301-2/+2
| | | | | At compilation time with RUBY_DEBUG enabled, check if the removal version has been reached.
* Scan the coderange in the given encodingNobuyoshi Nakada2021-06-261-9/+23
|
* Add Related link from String#hash to Object#hashKetan Bhatt2021-06-231-0/+2
| | | | | | We came across a bug in our code because we assumed `String#hash` to be consistent across Ruby processes, which was incorrect. Our search lead us to `Object#hash` which has the right warning that `String#hash` doesn't. We also noticed that a previous version of the documentation for `String#hash` pointed to `Object#hash` that was removed by https://github.com/ruby/ruby/pull/3565. We think this removal might not be intended and just got missed amidst other changes.