Skip to content

Commit

Permalink
🎨 Add code to check object movement bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshoku committed Jan 31, 2021
1 parent 399d376 commit 2f3bb5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
require 'parallel'
require 'mmh3'

if defined?(GC.verify_compaction_references) == 'method'
# Calling this method will help to find object movement bugs.
GC.verify_compaction_references(double_heap: true, toward: :empty)
end

def two_clusters_dataset
rng = Random.new(8)
x_a = (2 * Rumale::Utils.rand_uniform([100, 2], rng) - 1) + Numo::DFloat[-2, 0]
Expand Down

0 comments on commit 2f3bb5c

Please sign in to comment.