libmf 0.2.1 → 0.2.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: 1d7744d5436815acc2609c8c39566f5704513248b5fe0b7ddc1cc4fbd28c81e9
4
- data.tar.gz: 0bcd219cc9360b0e9daefe418e2a14fc46969ab174db5ea93717c837e309c697
3
+ metadata.gz: e654382e818f1b59bc4437e71bc3e0ae6f4d4d79b9c85aeb53fb3494b2baf888
4
+ data.tar.gz: 560fa519794c7cd8b29c27b9ac9f4247e0485e9f13f229c18a4562c8bee62868
5
5
  SHA512:
6
- metadata.gz: 49d31c33bea909e1a3a0a8cdebc6cce76b2cf19debc11420d76ad2016763961f376df56bdbba16e6a60e72a8014a2b44547045b2385f44b6c96f48f3f6148643
7
- data.tar.gz: 3f264d87a4cc727634ac8b2cb5dc87a56a44c3fba7d77093c83ca3623437be6024c04b1fe154275fd3a14a6736bf6703ea2fae9b984570b5c4629af3b5c710f3
6
+ metadata.gz: d16fb17f9b58cea5c53814a68fbf9de91440fd77e1669b52bbe5cb3a3837c94449d8bbc348405c0c117f219d2a513f1fc2e813b330ea127c93ac04a0c4101d07
7
+ data.tar.gz: 3d5d3962d3878fe992f76ef9d2fa5e30866d007cd5ae3ab97a666fc53f97f9f3f2487bb425e15b59becde6118c61ecac6c8511692742d64efa2b9e26fe0d2872
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.2.2 (2021-02-04)
2
+
3
+ - Reduced allocations
4
+ - Improved ARM detection
5
+
1
6
  ## 0.2.1 (2020-12-28)
2
7
 
3
8
  - Added ARM shared library for Mac
data/LICENSE.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  BSD 3-Clause License
2
2
 
3
3
  Copyright (c) 2014-2015, The LIBMF Project
4
- Copyright (c) 2019-2020, Andrew Kane
4
+ Copyright (c) 2019-2021, Andrew Kane
5
5
  All rights reserved.
6
6
 
7
7
  Redistribution and use in source and binary forms, with or without
data/lib/libmf.rb CHANGED
@@ -14,10 +14,12 @@ module Libmf
14
14
  lib_name =
15
15
  if Gem.win_platform?
16
16
  "mf.dll"
17
- elsif RbConfig::CONFIG["arch"] =~ /arm64-darwin/i
18
- "libmf.arm64.dylib"
19
17
  elsif RbConfig::CONFIG["host_os"] =~ /darwin/i
20
- "libmf.dylib"
18
+ if RbConfig::CONFIG["host_cpu"] =~ /arm/i
19
+ "libmf.arm64.dylib"
20
+ else
21
+ "libmf.dylib"
22
+ end
21
23
  else
22
24
  "libmf.so"
23
25
  end
data/lib/libmf/model.rb CHANGED
@@ -111,10 +111,11 @@ module Libmf
111
111
 
112
112
  # TODO do in C for better performance
113
113
  # can use FIX2INT() and RFLOAT_VALUE() instead of pack
114
+ # and write directly to C string
114
115
  buffer = String.new
116
+ pack_format = "iif"
115
117
  data.each do |row|
116
- row[0, 2].pack("i*".freeze, buffer: buffer)
117
- row[2, 1].pack("f".freeze, buffer: buffer)
118
+ row.pack(pack_format, buffer: buffer)
118
119
  end
119
120
 
120
121
  r = ::FFI::MemoryPointer.new(FFI::Node, data.size)
data/lib/libmf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Libmf
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libmf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-29 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description:
28
- email: andrew@chartkick.com
28
+ email: andrew@ankane.org
29
29
  executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []