<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/objspace, branch v3_0_7</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 1fac99afdae2671a9ca86bead5bde4d0e2eff1b4: [Backport #18030]</title>
<updated>2021-07-18T01:58:55+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-07-18T01:58:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ca6ebde821991cb558003c3a1d680eaa8df3169d'/>
<id>ca6ebde821991cb558003c3a1d680eaa8df3169d</id>
<content type='text'>
	skip marking for uninitialized imemo_env.

	RUBY_INTERNAL_EVENT_NEWOBJ can expose uninitialized imemo_env
	objects and marking it will cause critical error. This patch
	skips marking on uninitialized imemo_env.

	See: http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20210329T183003Z.fail.html.gz

	Shortest repro-code is provided by mame-san.
	---
	 gc.c                           | 16 ++++++++++------
	 test/objspace/test_objspace.rb | 13 +++++++++++++
	 2 files changed, 23 insertions(+), 6 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	skip marking for uninitialized imemo_env.

	RUBY_INTERNAL_EVENT_NEWOBJ can expose uninitialized imemo_env
	objects and marking it will cause critical error. This patch
	skips marking on uninitialized imemo_env.

	See: http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20210329T183003Z.fail.html.gz

	Shortest repro-code is provided by mame-san.
	---
	 gc.c                           | 16 ++++++++++------
	 test/objspace/test_objspace.rb | 13 +++++++++++++
	 2 files changed, 23 insertions(+), 6 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 1cdae49d39fbaef654df487f168d1fb14a146d59: [Backport #17577]</title>
<updated>2021-02-02T10:09:40+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2021-02-02T10:09:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=71b4638ca29a5d8a7d6f72e453513035d2096f47'/>
<id>71b4638ca29a5d8a7d6f72e453513035d2096f47</id>
<content type='text'>
	Implement NameError::message#clone for Ractor

	---
	 bootstraptest/test_ractor.rb   | 13 +++++++++++++
	 error.c                        | 35 +++++++++++++++++++++++++++++++++--
	 test/objspace/test_objspace.rb |  9 +++++++++
	 3 files changed, 55 insertions(+), 2 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Implement NameError::message#clone for Ractor

	---
	 bootstraptest/test_ractor.rb   | 13 +++++++++++++
	 error.c                        | 35 +++++++++++++++++++++++++++++++++--
	 test/objspace/test_objspace.rb |  9 +++++++++
	 3 files changed, 55 insertions(+), 2 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix ObjectSpace.dump(obj, output: :stdout)</title>
<updated>2020-10-02T15:00:01+00:00</updated>
<author>
<name>Kazuhiro NISHIYAMA</name>
<email>zn@mbf.nifty.com</email>
</author>
<published>2020-10-02T09:19:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d0a7189f26dcb185c76771823dcfd20d8d4a7e3e'/>
<id>d0a7189f26dcb185c76771823dcfd20d8d4a7e3e</id>
<content type='text'>
RDoc says `ObjectSpace.dump(obj, output: :stdout)   # =&gt; nil`,
but it returns STDOUT since fbba6bd4e3dff7a61965208fecae908f10c4edbe.

I think it is unintentional change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RDoc says `ObjectSpace.dump(obj, output: :stdout)   # =&gt; nil`,
but it returns STDOUT since fbba6bd4e3dff7a61965208fecae908f10c4edbe.

I think it is unintentional change.
</pre>
</div>
</content>
</entry>
<entry>
<title>Return nil when argument to ObjectSpace.internal_class_of is T_IMEMO</title>
<updated>2020-09-25T16:27:49+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2020-09-02T03:13:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=24820d508bc89775e10e4e3e6e07e192540cb4a2'/>
<id>24820d508bc89775e10e4e3e6e07e192540cb4a2</id>
<content type='text'>
The added test case crashes the interpreter because it makes
ObjectSpace.internal_class_of return the second VALUE slot of an AST
imemo object. The second VALUE slot of `struct rb_ast_struct` is
not a VALUE and not a pointer to a Ruby object.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The added test case crashes the interpreter because it makes
ObjectSpace.internal_class_of return the second VALUE slot of an AST
imemo object. The second VALUE slot of `struct rb_ast_struct` is
not a VALUE and not a pointer to a Ruby object.
</pre>
</div>
</content>
</entry>
<entry>
<title>Optimize ObjectSpace.dump_all</title>
<updated>2020-09-09T18:11:36+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2020-08-18T07:41:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5001cc47169614ea07d87651c95c2ee185e374e0'/>
<id>5001cc47169614ea07d87651c95c2ee185e374e0</id>
<content type='text'>
The two main optimization are:
  - buffer writes for improved performance
  - avoid formatting functions when possible

```

|                   |compare-ruby|built-ruby|
|:------------------|-----------:|---------:|
|dump_all_string    |       1.038|   195.925|
|                   |           -|   188.77x|
|dump_all_file      |      33.453|   139.645|
|                   |           -|     4.17x|
|dump_all_dev_null  |      44.030|   278.552|
|                   |           -|     6.33x|
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The two main optimization are:
  - buffer writes for improved performance
  - avoid formatting functions when possible

```

|                   |compare-ruby|built-ruby|
|:------------------|-----------:|---------:|
|dump_all_string    |       1.038|   195.925|
|                   |           -|   188.77x|
|dump_all_file      |      33.453|   139.645|
|                   |           -|     4.17x|
|dump_all_dev_null  |      44.030|   278.552|
|                   |           -|     6.33x|
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a :since option to dump_all</title>
<updated>2020-09-09T15:05:14+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2020-07-28T10:58:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b49a8704143ce47de0472b6033fc5797aed21f52'/>
<id>b49a8704143ce47de0472b6033fc5797aed21f52</id>
<content type='text'>
This is useful to see what a block of code allocated, e.g.

```
GC.start
GC.disable
ObjectSpace.trace_object_allocations do
  # run some code
end
gc_gen = GC.count
allocations = ObjectSpace.dump_all(output: :file, since: gc_gen)
GC.enable
GC.start
retentions = ObjectSpace.dump_all(output: :file, since: gc_gen)
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is useful to see what a block of code allocated, e.g.

```
GC.start
GC.disable
ObjectSpace.trace_object_allocations do
  # run some code
end
gc_gen = GC.count
allocations = ObjectSpace.dump_all(output: :file, since: gc_gen)
GC.enable
GC.start
retentions = ObjectSpace.dump_all(output: :file, since: gc_gen)
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix ObjectSpace.trace_object_allocations_stop to not raise if the tracepoint were not initialized</title>
<updated>2020-08-19T15:13:09+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2020-04-03T13:28:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a74df67244199d1fd1f7a20b49dd5a096d2a13a2'/>
<id>a74df67244199d1fd1f7a20b49dd5a096d2a13a2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Reset object allocation trace information</title>
<updated>2020-08-19T02:57:45+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2020-08-19T02:56:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7226f76255ff0fc209c973c6560f2331a676232b'/>
<id>7226f76255ff0fc209c973c6560f2331a676232b</id>
<content type='text'>
Compaction makes collisions in the weak map more likely.  For now, clear
the tracing information before the test run so we get accurate results
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Compaction makes collisions in the weak map more likely.  For now, clear
the tracing information before the test run so we get accurate results
</pre>
</div>
</content>
</entry>
<entry>
<title>Update references when tracing allocations</title>
<updated>2020-08-19T02:10:51+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2020-08-19T00:34:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7a58ee9b962ad0072e5213d3512c809048e4eba1'/>
<id>7a58ee9b962ad0072e5213d3512c809048e4eba1</id>
<content type='text'>
The allocation tracing code keeps essentially a weak reference to
objects that have been allocated (storing the allocation information
along with the weak ref).  Compacting the heap would break references in
this weak map, so the wrong values could be returned.

This commit just updates the values in the weak ref in order to fix the
allocation tracing book keeping
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The allocation tracing code keeps essentially a weak reference to
objects that have been allocated (storing the allocation information
along with the weak ref).  Compacting the heap would break references in
this weak map, so the wrong values could be returned.

This commit just updates the values in the weak ref in order to fix the
allocation tracing book keeping
</pre>
</div>
</content>
</entry>
<entry>
<title>Disable debugging test.</title>
<updated>2020-08-17T17:23:12+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2020-08-17T17:22:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bc00e6aa909631c995473bc2f3d62fbe60b16ffe'/>
<id>bc00e6aa909631c995473bc2f3d62fbe60b16ffe</id>
<content type='text'>
```
  1) Failure:
TestObjSpace#test_trace_object_allocations [/tmp/ruby/v3/src/trunk-gc_compact/test/objspace/test_objspace.rb:175]:
&lt;nil&gt; expected but was
&lt;"/tmp/ruby/v3/src/trunk-gc_compact/test/objspace/test_objspace.rb"&gt;.
```

@tenderlove will re-enable it soon.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
  1) Failure:
TestObjSpace#test_trace_object_allocations [/tmp/ruby/v3/src/trunk-gc_compact/test/objspace/test_objspace.rb:175]:
&lt;nil&gt; expected but was
&lt;"/tmp/ruby/v3/src/trunk-gc_compact/test/objspace/test_objspace.rb"&gt;.
```

@tenderlove will re-enable it soon.
</pre>
</div>
</content>
</entry>
</feed>
