numo-liblinear 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 582af5c3cacbe43a05329bd6d355a89c4bff8ac52aceacedb50a20ae61703dd0
4
- data.tar.gz: c522cd810baa4f5b57065a52675479ea9ad563b32d2608e03f42639b929a6753
3
+ metadata.gz: 7938dffc0715abee4a64bbbc91434f9d4fbc075b442443d443cfc84c98676792
4
+ data.tar.gz: 280c66c821e95c06832902cefe3eae82931fed7cd9c99a56c9119149877b21f7
5
5
  SHA512:
6
- metadata.gz: 4b1d93cbcadf64aa4eddb44f47b1d0725d6002201393b8dc926f8288214609b140381beaa1ed09a47180a640c0d9b93612b5d2d1fb70c1c81c74caebcc1fc7de
7
- data.tar.gz: 3d254a3ca1ab5075c1b5a5cc84a64e40473d7e8575368f5eface0585eaa52eaa6c515fd7f43be4460c82b7aad7e95e02982a8c1e45c06cbe550266da8dee6db2
6
+ metadata.gz: d3535760b9f5089c3bc4a46299385e0e0ba77ffc126cd6c9c64e02e00e17ed57ed8c48096773b0fc783203514d525edbc104dda50dd2ab60d592481ea84bd052
7
+ data.tar.gz: 173e630b063820b0b34727e1b8371f22fd67916bdd4e374d23cabeaa61cccad868ff3b0d618c71d55d564e6a05f54eb879a887bda98ccaca786b946a3ae04851
@@ -1,3 +1,7 @@
1
+ # 1.1.2
2
+ - Add GC guard to model saving and loading methods.
3
+ - Fix size specification to memcpy function.
4
+
1
5
  # 1.1.1
2
6
  - Add GC guard codes.
3
7
  - Fix some configuration files.
@@ -504,6 +504,8 @@ VALUE numo_liblinear_load_model(VALUE self, VALUE filename)
504
504
  rb_ary_store(res, 0, param_hash);
505
505
  rb_ary_store(res, 1, model_hash);
506
506
 
507
+ RB_GC_GUARD(filename);
508
+
507
509
  return res;
508
510
  }
509
511
 
@@ -538,6 +540,8 @@ VALUE numo_liblinear_save_model(VALUE self, VALUE filename, VALUE param_hash, VA
538
540
  return Qfalse;
539
541
  }
540
542
 
543
+ RB_GC_GUARD(filename);
544
+
541
545
  return Qtrue;
542
546
  }
543
547
 
@@ -46,13 +46,13 @@ struct parameter* rb_hash_to_parameter(VALUE param_hash)
46
46
  param->weight_label = NULL;
47
47
  if (!NIL_P(el)) {
48
48
  param->weight_label = ALLOC_N(int, param->nr_weight);
49
- memcpy(param->weight_label, (int32_t*)na_get_pointer_for_read(el), param->nr_weight);
49
+ memcpy(param->weight_label, (int32_t*)na_get_pointer_for_read(el), param->nr_weight * sizeof(int32_t));
50
50
  }
51
51
  el = rb_hash_aref(param_hash, ID2SYM(rb_intern("weight")));
52
52
  param->weight = NULL;
53
53
  if (!NIL_P(el)) {
54
54
  param->weight = ALLOC_N(double, param->nr_weight);
55
- memcpy(param->weight, (double*)na_get_pointer_for_read(el), param->nr_weight);
55
+ memcpy(param->weight, (double*)na_get_pointer_for_read(el), param->nr_weight * sizeof(double));
56
56
  }
57
57
  el = rb_hash_aref(param_hash, ID2SYM(rb_intern("p")));
58
58
  param->p = !NIL_P(el) ? NUM2DBL(el) : 0.1;
@@ -3,6 +3,6 @@
3
3
  module Numo
4
4
  module Liblinear
5
5
  # The version of Numo::Liblienar you are using.
6
- VERSION = '1.1.1'
6
+ VERSION = '1.1.2'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numo-liblinear
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-16 00:00:00.000000000 Z
11
+ date: 2021-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-narray
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  requirements: []
152
- rubygems_version: 3.1.4
152
+ rubygems_version: 3.2.3
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Numo::Liblinear is a Ruby gem binding to the LIBLINEAR library. Numo::Liblinear