bootsnap 1.20.0 → 1.21.0
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: adb5e1d46d7560b403e6ef7051f9ad2ef21feca194c41f0af77f2e73d6e06508
|
|
4
|
+
data.tar.gz: cebcb8c52f1da65f13c531d05f5150fbe2b54d3fa51e0122b2cf4f2998cb63b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ff78c410b363a8e2fbc9e370b684865a3aaa45e6de961d9d8dd6b1207fa2002a4d0115751ad5b259e21d69d215a4859587da79386e3b6d0cdde7e54205620d2
|
|
7
|
+
data.tar.gz: bac1b52dfad5b0e0e1e03e6feeeb2c9d3555608410b7a73fc005e044bf31641aa8bdd72bf4f595eee69b7c58e4701579c5e6961a4937246567ef097bb9956aaf
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Unreleased
|
|
2
2
|
|
|
3
|
+
# 1.21.0
|
|
4
|
+
|
|
5
|
+
* Fix the `require` decorator to handle `Bootsnap.unload_cache!` being called.
|
|
6
|
+
* Minor optimization: Eagerly clear cache buffers to appease the GC.
|
|
7
|
+
|
|
8
|
+
# 1.20.1
|
|
9
|
+
|
|
10
|
+
* Handle broken symlinks in load path scanning code.
|
|
11
|
+
Should fix `Errno::ENOENT fstatat` issues some users have encountered after upgrading to 1.20.0.
|
|
12
|
+
|
|
3
13
|
# 1.20.0
|
|
4
14
|
|
|
5
15
|
* Optimized load path scanning with a C extension. Should be about 2x faster on supported platforms.
|
data/ext/bootsnap/bootsnap.c
CHANGED
|
@@ -50,7 +50,9 @@ module Bootsnap
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def self.storage_to_output(binary, _args)
|
|
53
|
-
RubyVM::InstructionSequence.load_from_binary(binary)
|
|
53
|
+
iseq = RubyVM::InstructionSequence.load_from_binary(binary)
|
|
54
|
+
binary.clear
|
|
55
|
+
iseq
|
|
54
56
|
rescue RuntimeError => error
|
|
55
57
|
if error.message == "broken binary format"
|
|
56
58
|
$stderr.puts("[Bootsnap::CompileCache] warning: rejecting broken binary")
|
|
@@ -170,7 +170,9 @@ module Bootsnap
|
|
|
170
170
|
unpacker = CompileCache::YAML.msgpack_factory.unpacker(kwargs)
|
|
171
171
|
unpacker.feed(data)
|
|
172
172
|
_safe_loaded = unpacker.unpack
|
|
173
|
-
unpacker.unpack
|
|
173
|
+
result = unpacker.unpack
|
|
174
|
+
data.clear
|
|
175
|
+
result
|
|
174
176
|
end
|
|
175
177
|
|
|
176
178
|
def input_to_output(data, kwargs)
|
|
@@ -15,8 +15,11 @@ module Kernel
|
|
|
15
15
|
if Bootsnap::LoadPathCache::FALLBACK_SCAN.equal?(resolved)
|
|
16
16
|
if (cursor = Bootsnap::LoadPathCache.loaded_features_index.cursor(string_path))
|
|
17
17
|
ret = require_without_bootsnap(path)
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
|
|
19
|
+
# The file we required may have unloaded the cache
|
|
20
|
+
resolved = Bootsnap::LoadPathCache.loaded_features_index&.identify(string_path, cursor)
|
|
21
|
+
Bootsnap::LoadPathCache.loaded_features_index&.register(string_path, resolved)
|
|
22
|
+
|
|
20
23
|
return ret
|
|
21
24
|
else
|
|
22
25
|
return require_without_bootsnap(path)
|
|
@@ -28,7 +31,9 @@ module Kernel
|
|
|
28
31
|
else
|
|
29
32
|
# Note that require registers to $LOADED_FEATURES while load does not.
|
|
30
33
|
ret = require_without_bootsnap(resolved)
|
|
31
|
-
|
|
34
|
+
|
|
35
|
+
# The file we required may have unloaded the cache
|
|
36
|
+
Bootsnap::LoadPathCache.loaded_features_index&.register(string_path, resolved)
|
|
32
37
|
return ret
|
|
33
38
|
end
|
|
34
39
|
end
|
data/lib/bootsnap/version.rb
CHANGED