diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2020-09-26 15:49:43 -0400 |
---|---|---|
committer | Marc-André Lafortune <github@marc-andre.ca> | 2020-12-09 02:15:41 -0500 |
commit | a7dccd08e7c9cf0e5d0c0fdbe659ccc921624e6f (patch) | |
tree | 1cbb857586e30af448e5cd59321a09799ce74f5d /lib | |
parent | 6b264e833f9b9c86819feff88048ffcdf8d67af8 (diff) | |
download | ruby-a7dccd08e7c9cf0e5d0c0fdbe659ccc921624e6f.tar.gz |
[ruby/matrix] Make frozen matrices Ractor shareable
Diffstat (limited to 'lib')
-rw-r--r-- | lib/matrix.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb index c6193ebee1..32f1e233ce 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -532,7 +532,8 @@ class Matrix alias map! collect! def freeze - @rows.freeze + @rows.each(&:freeze).freeze + super end @@ -2141,6 +2142,9 @@ class Vector all?(&:zero?) end + # + # Makes the matrix frozen and Ractor-shareable + # def freeze @elements.freeze super |