<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/-ext-/string/test_capacity.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Add shape_id to RBasic under 32 bit</title>
<updated>2025-05-26T08:31:54+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-05-14T18:06:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f483befd9065d159d3a944b87fe26179c5373c30'/>
<id>f483befd9065d159d3a944b87fe26179c5373c30</id>
<content type='text'>
This makes `RBobject` `4B` larger on 32 bit systems
but simplifies the implementation a lot.

[Feature #21353]

Co-authored-by: Jean Boussier &lt;byroot@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes `RBobject` `4B` larger on 32 bit systems
but simplifies the implementation a lot.

[Feature #21353]

Co-authored-by: Jean Boussier &lt;byroot@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>String.new(capacity:) don't substract termlen</title>
<updated>2024-06-19T13:11:07+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2024-06-19T12:04:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=83f57ca3d225ce06abbc5eef6aec37de4fa36d58'/>
<id>83f57ca3d225ce06abbc5eef6aec37de4fa36d58</id>
<content type='text'>
[Bug #20585]

This was changed in 36a06efdd9f0604093dccbaf96d4e2cb17874dc8 because
`String.new(1024)` would end up allocating `1025` bytes, but the problem
with this change is that the caller may be trying to right size a String.

So instead, we should just better document the behavior of `capacity:`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #20585]

This was changed in 36a06efdd9f0604093dccbaf96d4e2cb17874dc8 because
`String.new(1024)` would end up allocating `1025` bytes, but the problem
with this change is that the caller may be trying to right size a String.

So instead, we should just better document the behavior of `capacity:`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make String.new size pools aware.</title>
<updated>2023-11-02T22:34:58+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-11-02T10:02:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ac8ec004e5272d589caca30616dbe12862150188'/>
<id>ac8ec004e5272d589caca30616dbe12862150188</id>
<content type='text'>
If the required capacity would fit in an embded string,
returns one.

This can reduce malloc churn for code that use string buffers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the required capacity would fit in an embded string,
returns one.

This can reduce malloc churn for code that use string buffers.
</pre>
</div>
</content>
</entry>
<entry>
<title>Unify length field for embedded and heap strings  (#7908)</title>
<updated>2023-06-06T14:19:20+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-06-06T14:19:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7577c101ed6452de3e72fadb43db595946acc701'/>
<id>7577c101ed6452de3e72fadb43db595946acc701</id>
<content type='text'>
* Unify length field for embedded and heap strings

The length field is of the same type and position in RString for both
embedded and heap allocated strings, so we can unify it.

* Remove RSTRING_EMBED_LEN</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Unify length field for embedded and heap strings

The length field is of the same type and position in RString for both
embedded and heap allocated strings, so we can unify it.

* Remove RSTRING_EMBED_LEN</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #19579] Remove !USE_RVARGC code (#7655)</title>
<updated>2023-04-04T21:30:06+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-04-04T21:30:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1da2e7fca35dc697d85dd91d2572ab58d08cd3bc'/>
<id>1da2e7fca35dc697d85dd91d2572ab58d08cd3bc</id>
<content type='text'>
Remove !USE_RVARGC code

[Feature #19579]

The Variable Width Allocation feature was turned on by default in Ruby
3.2. Since then, we haven't received bug reports or backports to the
non-Variable Width Allocation code paths, so we assume that nobody is
using it. We also don't plan on maintaining the non-Variable Width
Allocation code, so we are going to remove it.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove !USE_RVARGC code

[Feature #19579]

The Variable Width Allocation feature was turned on by default in Ruby
3.2. Since then, we haven't received bug reports or backports to the
non-Variable Width Allocation code paths, so we assume that nobody is
using it. We also don't plan on maintaining the non-Variable Width
Allocation code, so we are going to remove it.</pre>
</div>
</content>
</entry>
<entry>
<title>Decouple GC slot sizes from RVALUE</title>
<updated>2022-02-02T14:52:04+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-02-01T14:25:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7b77d46671685c837adc33b39ae0210e04cd8b24'/>
<id>7b77d46671685c837adc33b39ae0210e04cd8b24</id>
<content type='text'>
Add a new macro BASE_SLOT_SIZE that determines the slot size.

For Variable Width Allocation (compiled with USE_RVARGC=1), all slot
sizes are powers-of-2 multiples of BASE_SLOT_SIZE.

For USE_RVARGC=0, BASE_SLOT_SIZE is set to sizeof(RVALUE).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new macro BASE_SLOT_SIZE that determines the slot size.

For Variable Width Allocation (compiled with USE_RVARGC=1), all slot
sizes are powers-of-2 multiples of BASE_SLOT_SIZE.

For USE_RVARGC=0, BASE_SLOT_SIZE is set to sizeof(RVALUE).
</pre>
</div>
</content>
</entry>
<entry>
<title>Make embedded string length a long for VWA</title>
<updated>2022-01-12T17:00:55+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-01-11T20:19:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2d81a718eca679b9bf458beccf1e7a86b812c3e2'/>
<id>2d81a718eca679b9bf458beccf1e7a86b812c3e2</id>
<content type='text'>
A short (2 bytes) will cause unaligned struct accesses when strings are
used as a buffer to directly store binary data.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A short (2 bytes) will cause unaligned struct accesses when strings are
used as a buffer to directly store binary data.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #18239] Implement VWA for strings</title>
<updated>2021-10-25T17:26:23+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2021-08-26T14:06:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a5b6598192c30187b19b892af3110a46f6a70d76'/>
<id>a5b6598192c30187b19b892af3110a46f6a70d76</id>
<content type='text'>
This commit adds support for embedded strings with variable capacity and
uses Variable Width Allocation to allocate strings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds support for embedded strings with variable capacity and
uses Variable Width Allocation to allocate strings.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[EXPERIMENTAL] Make Symbol#to_s return a frozen String [Feature #16150]"</title>
<updated>2019-11-05T08:30:54+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2019-11-05T08:30:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bea322a352d820007dd4e6cab88af5de01854736'/>
<id>bea322a352d820007dd4e6cab88af5de01854736</id>
<content type='text'>
This reverts commit 6ffc045a817fbdf04a6945d3c260b55b0fa1fd1e.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 6ffc045a817fbdf04a6945d3c260b55b0fa1fd1e.
</pre>
</div>
</content>
</entry>
<entry>
<title>[EXPERIMENTAL] Make Symbol#to_s return a frozen String</title>
<updated>2019-09-26T08:23:02+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2019-09-08T09:53:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6ffc045a817fbdf04a6945d3c260b55b0fa1fd1e'/>
<id>6ffc045a817fbdf04a6945d3c260b55b0fa1fd1e</id>
<content type='text'>
* Always the same frozen String for a given Symbol.
* Avoids extra allocations whenever calling Symbol#to_s.
* See [Feature #16150]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Always the same frozen String for a given Symbol.
* Avoids extra allocations whenever calling Symbol#to_s.
* See [Feature #16150]
</pre>
</div>
</content>
</entry>
</feed>
