dcm 0.2.3 → 0.3.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 +4 -4
- data/lib/file_cache.rb +4 -0
- 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: 18dede35d3ee32cb0e3d9c2f64add8822e0c927d729aba594c922480a1917811
|
|
4
|
+
data.tar.gz: 850d0940009caab91c25c796ce3e0dc762865a23925c771f78cdc1f347f61fc2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e086050c6193c0e5efcb45bbc7f82e00d02b4281b100b0ccc4d15d665df735bbc329f751372380090bc6088c58504ec41c420598f16f1cb924c1c1d2a3ae5a3
|
|
7
|
+
data.tar.gz: 5e866c756d01eeb9a6d2f9bbd5e0696cba6d039b0d11e1f9a62d4ce96edfe673ce88c43ee4aa64af12c2958e91167b6ff930321c2b698f0e1e87b08c81ccf264
|
data/lib/file_cache.rb
CHANGED
|
@@ -51,9 +51,13 @@ class FileCache
|
|
|
51
51
|
|
|
52
52
|
# An unreadable cache (e.g. written by an older version) counts as a miss
|
|
53
53
|
def read_cache
|
|
54
|
+
# Unmarshalling allocates millions of objects; GC passes would only slow it down
|
|
55
|
+
GC.disable
|
|
54
56
|
Marshal.load(File.binread(cachefilepath))
|
|
55
57
|
rescue ArgumentError, TypeError, EOFError, SystemCallError
|
|
56
58
|
nil
|
|
59
|
+
ensure
|
|
60
|
+
GC.enable
|
|
57
61
|
end
|
|
58
62
|
|
|
59
63
|
def write_cache(obj)
|
data/lib/version.rb
CHANGED