bootsnap 1.20.1 → 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: 19e8b61a552b7f3c9bb4425cbbd58581aff5fed55607ca105b84bc414bb2dbed
4
- data.tar.gz: c9aed95261640936c810231f33392b909039d8f09b33883f0e9082b0cf7ead9f
3
+ metadata.gz: adb5e1d46d7560b403e6ef7051f9ad2ef21feca194c41f0af77f2e73d6e06508
4
+ data.tar.gz: cebcb8c52f1da65f13c531d05f5150fbe2b54d3fa51e0122b2cf4f2998cb63b9
5
5
  SHA512:
6
- metadata.gz: 65607260e60599f4d0ed4c30bf43bc2b42a8e22611fcba4f1cd3abb3563a1158556e22cb78e05ba16af5c55b97ecf88d45a63c2a65d9f28082bc0d75ec759174
7
- data.tar.gz: 0ac04f4093bddc1457fbd3dc9b14083570c36f6cf0f19ab9ac62f93112944502b32f483e01c11b2c112349ca4c2811480a12e3112ed2ddbe8cb0e4f35977928a
6
+ metadata.gz: 6ff78c410b363a8e2fbc9e370b684865a3aaa45e6de961d9d8dd6b1207fa2002a4d0115751ad5b259e21d69d215a4859587da79386e3b6d0cdde7e54205620d2
7
+ data.tar.gz: bac1b52dfad5b0e0e1e03e6feeeb2c9d3555608410b7a73fc005e044bf31641aa8bdd72bf4f595eee69b7c58e4701579c5e6961a4937246567ef097bb9956aaf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
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
+
3
8
  # 1.20.1
4
9
 
5
10
  * Handle broken symlinks in load path scanning code.
@@ -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
- resolved = Bootsnap::LoadPathCache.loaded_features_index.identify(string_path, cursor)
19
- Bootsnap::LoadPathCache.loaded_features_index.register(string_path, resolved)
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
- Bootsnap::LoadPathCache.loaded_features_index.register(string_path, resolved)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bootsnap
4
- VERSION = "1.20.1"
4
+ VERSION = "1.21.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootsnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.1
4
+ version: 1.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  requirements: []
82
- rubygems_version: 3.6.9
82
+ rubygems_version: 4.0.3
83
83
  specification_version: 4
84
84
  summary: Boot large ruby/rails apps faster
85
85
  test_files: []