<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/gc.c, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Use `PRIuSIZE` instead of `%zu` for `size_t` (#9359)</title>
<updated>2024-09-24T17:50:33+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-09-24T17:50:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d8966416d010719ef8f1689137da31aa75e71198'/>
<id>d8966416d010719ef8f1689137da31aa75e71198</id>
<content type='text'>
Co-authored-by: Takashi Kokubun &lt;takashikkbn@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Takashi Kokubun &lt;takashikkbn@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Fixes [Bug #20718] (#11576)</title>
<updated>2024-09-11T00:38:48+00:00</updated>
<author>
<name>Jonathan Calvert</name>
<email>athemeus@athemeus.com</email>
</author>
<published>2024-09-11T00:38:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=55ddfd58dd6e67e88cf9a3e55bf99550affe8b3f'/>
<id>55ddfd58dd6e67e88cf9a3e55bf99550affe8b3f</id>
<content type='text'>
Fixes [Bug #20718]

Allow objects that are not of type `RTypedData` to use the default free function, as `RTYPEDDATA_EMBEDDED_P` can return a false positive when casting non-`RTypedData` objects</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #20718]

Allow objects that are not of type `RTypedData` to use the default free function, as `RTYPEDDATA_EMBEDDED_P` can return a false positive when casting non-`RTypedData` objects</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 081ee3d35509110f383cb7dd8d1205def0cdd1e8,1c97abaabae6844c861705fd07f532292dcffa74: [Backport #19907] (#10315)</title>
<updated>2024-03-21T02:23:21+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>nurse@users.noreply.github.com</email>
</author>
<published>2024-03-21T02:23:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=57a0afe2090b8d05673d650b1e8bf9ae67449b1f'/>
<id>57a0afe2090b8d05673d650b1e8bf9ae67449b1f</id>
<content type='text'>
Add memory leak test for eval kwargs

	De-dup identical callinfo objects

	Previously every call to vm_ci_new (when the CI was not packable) would
	result in a different callinfo being returned this meant that every
	kwarg callsite had its own CI.

	When calling, different CIs result in different CCs. These CIs and CCs
	both end up persisted on the T_CLASS inside cc_tbl. So in an eval loop
	this resulted in a memory leak of both types of object. This also likely
	resulted in extra memory used, and extra time searching, in non-eval
	cases.

	For simplicity in this commit I always allocate a CI object inside
	rb_vm_ci_lookup, but ideally we would lazily allocate it only when
	needed. I hope to do that as a follow up in the future.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add memory leak test for eval kwargs

	De-dup identical callinfo objects

	Previously every call to vm_ci_new (when the CI was not packable) would
	result in a different callinfo being returned this meant that every
	kwarg callsite had its own CI.

	When calling, different CIs result in different CCs. These CIs and CCs
	both end up persisted on the T_CLASS inside cc_tbl. So in an eval loop
	this resulted in a memory leak of both types of object. This also likely
	resulted in extra memory used, and extra time searching, in non-eval
	cases.

	For simplicity in this commit I always allocate a CI object inside
	rb_vm_ci_lookup, but ideally we would lazily allocate it only when
	needed. I hope to do that as a follow up in the future.</pre>
</div>
</content>
</entry>
<entry>
<title>Backport #20157 to Ruby 3.3 (#9428)</title>
<updated>2024-02-01T04:33:30+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>ktsanaktsidis@zendesk.com</email>
</author>
<published>2024-02-01T04:33:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=920c17dc94239baae05b513046b27967f11a3569'/>
<id>920c17dc94239baae05b513046b27967f11a3569</id>
<content type='text'>
* Fix GC.measure_total_time regression

Commit 93ac7405b80cc61930d73da04441fa09af1851e1 introduced a regression
where measurements would still be taken after setting
GC.measure_total_time = false.

Fixes [Bug #20157]

* Add test case for GC.measure_total_time

---------

Co-authored-by: Rian McGuire &lt;rian@rian.id.au&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix GC.measure_total_time regression

Commit 93ac7405b80cc61930d73da04441fa09af1851e1 introduced a regression
where measurements would still be taken after setting
GC.measure_total_time = false.

Fixes [Bug #20157]

* Add test case for GC.measure_total_time

---------

Co-authored-by: Rian McGuire &lt;rian@rian.id.au&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Fix off-by-one error for declarative marking</title>
<updated>2023-12-25T01:37:59+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-12-24T21:23:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=70618a48f7f9f12943e963bf121b56af4153f394'/>
<id>70618a48f7f9f12943e963bf121b56af4153f394</id>
<content type='text'>
The for loops for marking and reference updating declaratively marked
TypedData objects did not mark/reference update the very last element.

When RGENGC_CHECK_MODE is turned on, this caused the test in Enumerator
to fail with:

    tool/lib/test/unit/testcase.rb:173:in `rescue in run': failed to allocate memory (NoMemoryError)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The for loops for marking and reference updating declaratively marked
TypedData objects did not mark/reference update the very last element.

When RGENGC_CHECK_MODE is turned on, this caused the test in Enumerator
to fail with:

    tool/lib/test/unit/testcase.rb:173:in `rescue in run': failed to allocate memory (NoMemoryError)
</pre>
</div>
</content>
</entry>
<entry>
<title>Correct free_on_exit env var to free_at_exit</title>
<updated>2023-12-20T05:36:32+00:00</updated>
<author>
<name>HParker</name>
<email>HParker@github.com</email>
</author>
<published>2023-12-20T05:12:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7ef90b3978dad057ad6360a94d2d64e8ca5e9c38'/>
<id>7ef90b3978dad057ad6360a94d2d64e8ca5e9c38</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Support `GC.auto_compact = :empty` on debug builds</title>
<updated>2023-12-19T23:29:36+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-12-18T21:55:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=32ecda354f1556edbfdba4723716fa523acbc94d'/>
<id>32ecda354f1556edbfdba4723716fa523acbc94d</id>
<content type='text'>
This commit adds `GC.auto_compact = :empty` which will run
auto-compaction sorting pages by empty slots so the most amount of
objects will be moved. This will make it easier to write tests for
auto-compaction.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds `GC.auto_compact = :empty` which will run
auto-compaction sorting pages by empty slots so the most amount of
objects will be moved. This will make it easier to write tests for
auto-compaction.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use RICLASS_OWNS_M_TBL_P</title>
<updated>2023-12-19T20:21:28+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-12-19T20:21:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=50d39219a9b5f19a536c02ec47b54b79efa015f5'/>
<id>50d39219a9b5f19a536c02ec47b54b79efa015f5</id>
<content type='text'>
It's more consistent with gc_mark_children.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's more consistent with gc_mark_children.
</pre>
</div>
</content>
</entry>
<entry>
<title>restore the stack pointer on finalizer</title>
<updated>2023-12-19T08:59:49+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-12-19T08:32:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f9a48548cf3ef54fc0a385ccd78c708737055ecc'/>
<id>f9a48548cf3ef54fc0a385ccd78c708737055ecc</id>
<content type='text'>
When error on finalizer, the exception will be ignored.
To restart the code, we need to restore the stack pointer.

fix [Bug #20042]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When error on finalizer, the exception will be ignored.
To restart the code, we need to restore the stack pointer.

fix [Bug #20042]
</pre>
</div>
</content>
</entry>
<entry>
<title>Reset pinned_slots at the beginning of GC</title>
<updated>2023-12-18T15:37:21+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-12-12T15:19:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f35fec771047de15127c0e00d22b9eccd5487f51'/>
<id>f35fec771047de15127c0e00d22b9eccd5487f51</id>
<content type='text'>
pinned_slots is not being reset every GC, which causes this assertion to
fail:

```
Assertion Failed: gc.c:7076:gc_pin:GET_HEAP_PAGE(obj)-&gt;pinned_slots &lt;= GET_HEAP_PAGE(obj)-&gt;total_slots
```

This commit changes it to reset it at the beginning of every compaction
GC cycle.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pinned_slots is not being reset every GC, which causes this assertion to
fail:

```
Assertion Failed: gc.c:7076:gc_pin:GET_HEAP_PAGE(obj)-&gt;pinned_slots &lt;= GET_HEAP_PAGE(obj)-&gt;total_slots
```

This commit changes it to reset it at the beginning of every compaction
GC cycle.
</pre>
</div>
</content>
</entry>
</feed>
