Skip to content

Commit 5518ba1

Browse files
committed
Test valgrind
1 parent 7e4c8fd commit 5518ba1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ jobs:
1616
- if: ${{ startsWith(matrix.os, 'macos') }}
1717
run: brew install libomp
1818
- run: bundle exec rake vendor:all
19-
- run: bundle exec rake test
19+
- run: sudo apt-get update && sudo apt-get install valgrind
20+
- run: valgrind --leak-check=yes bundle exec rake test

lib/thundersvm/model.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def create_dataset(x, y = nil)
158158
end
159159

160160
def str_ptr(arr)
161-
ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP * arr.size, Fiddle::RUBY_FREE)
161+
ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP * arr.size)
162162
str_ptrs = arr.map { |v| Fiddle::Pointer["#{v}\x00"] }
163163
str_ptrs.each_with_index do |v, i|
164164
ptr[i * Fiddle::SIZEOF_VOIDP, Fiddle::SIZEOF_VOIDP] = v.ref

0 commit comments

Comments
 (0)