raindown 0.21.2 → 0.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/raindown/yjit.rb +15 -7
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 714d64b4843d94b4752da53527dcc7c2f3e1fe77ce4aea56aec0ca0b76dfaa6a
|
|
4
|
+
data.tar.gz: be27d12a02197bcac1b2ef6f404779de9a47a3d8047787db4291731e4ff3cbc9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b90a67a177422426703135277ab357e1d332968303ca4adaca91043f99b8ae70f91ab52de03097d1f307ea52519ef687edce28f4b08eafd9d69b0a6caf8b9885
|
|
7
|
+
data.tar.gz: 6d1e00f5edcdaabeecc8bb87b2a9854f075649efe4dee83447156eaff48c5c3f4d58ae4ba88a0ab8bfd21f69902b10cc0996f8f5969ae2d3c2276999b1506d99
|
data/lib/raindown/yjit.rb
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Raindown
|
|
4
|
-
# Ruby leaves YJIT off unless asked, which makes nodes that compute in loops several times faster.
|
|
4
|
+
# Ruby leaves YJIT off unless asked, which makes nodes that compute in loops several times faster. A Ruby built
|
|
5
|
+
# without it, like ruby.wasm's, has no RubyVM::YJIT.
|
|
5
6
|
module Yjit
|
|
7
|
+
# The runtime a macOS binary carries, signed to allow YJIT, as its folder in tebako's cache and its SHA-256, which
|
|
8
|
+
# rakelib's tebako task writes into the package.
|
|
9
|
+
RUNTIME = File.expand_path('../../yjit_runtime', __dir__)
|
|
10
|
+
|
|
6
11
|
module_function
|
|
7
12
|
|
|
8
13
|
def enable
|
|
9
|
-
RubyVM::YJIT.enable if
|
|
14
|
+
RubyVM::YJIT.enable if defined?(RubyVM::YJIT) && allowed?
|
|
10
15
|
end
|
|
11
16
|
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
def
|
|
15
|
-
return
|
|
17
|
+
# macOS kills a binary as soon as it runs code YJIT compiled, unless its runtime's signed to allow it. The binary
|
|
18
|
+
# carries one that is, but tebako runs the one it cached first, which an earlier binary may have left, tebako's own.
|
|
19
|
+
def allowed?
|
|
20
|
+
return true unless RUBY_PLATFORM.include?('darwin') && __dir__.start_with?('/__tfs__/')
|
|
21
|
+
return false unless File.exist?(RUNTIME)
|
|
16
22
|
|
|
17
|
-
|
|
23
|
+
folder, digest = File.read(RUNTIME).split
|
|
24
|
+
cached = File.join(Dir.home, '.tebako', 'runtimes', folder, 'sha256')
|
|
25
|
+
File.exist?(cached) && File.read(cached).start_with?(digest)
|
|
18
26
|
end
|
|
19
27
|
end
|
|
20
28
|
end
|
data/lib/version.rb
CHANGED