prometheus-client-mmap 1.0.3-x86_64-darwin → 1.1.1-x86_64-darwin

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: 0b5d1affad5caf3818770e6abeb7bfcffc9325bc6a2864c26d8f1e3e27b88037
4
- data.tar.gz: 47fedb5c6d451c893e7358d160edb7e536a9feec2e93e1567ccf43fbb9d3593b
3
+ metadata.gz: 55e103e30301c4574bdc808d8981c6aa9836b6ecd94bb3b5476b371aec275365
4
+ data.tar.gz: 21e9bfa51ffdab8c5c8b7b505fadd968ac2fe30d068a3aea5f773701105c5575
5
5
  SHA512:
6
- metadata.gz: 76eb009069b02bf80c9bb19cb2cfc2895e38f74510553670d10a21c3ef2d4dfb9a3f3fe6630a3db4c77e3412d64dce49bfc76374ce6cba1ea04e07cd0ee47ccd
7
- data.tar.gz: 22d52dcfc571aa29eaba92264bee6fa77c0db42a231ad796f16c16cc6d478c18fd6197cefcf9a4c97dd03ee8c15a26b81b04b25179e74864ae10326ab0cf6751
6
+ metadata.gz: 0f1d991404f54d5e6372517053cda164d4e08c4037300d1e5c2279c0eaa07c0394be1f5b988e0713d21c19a60a617464cd821f5ce2751dab48c818f7efa1d4b6
7
+ data.tar.gz: fbbb75e808e061b24ae5b0dbb75c7f81a2c5a05d6c4a9c7ccba0199fae347f8c7da9b064dbae82f32fe3bbf9bf31a31ec163addde1d06731434f31ddc70e8431
@@ -4,24 +4,31 @@ version = 3
4
4
 
5
5
  [[package]]
6
6
  name = "ahash"
7
- version = "0.8.3"
7
+ version = "0.8.7"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
9
+ checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
10
10
  dependencies = [
11
11
  "cfg-if",
12
12
  "once_cell",
13
13
  "version_check",
14
+ "zerocopy",
14
15
  ]
15
16
 
16
17
  [[package]]
17
18
  name = "aho-corasick"
18
- version = "0.7.20"
19
+ version = "1.1.2"
19
20
  source = "registry+https://github.com/rust-lang/crates.io-index"
20
- checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
21
+ checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
21
22
  dependencies = [
22
23
  "memchr",
23
24
  ]
24
25
 
26
+ [[package]]
27
+ name = "allocator-api2"
28
+ version = "0.2.16"
29
+ source = "registry+https://github.com/rust-lang/crates.io-index"
30
+ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
31
+
25
32
  [[package]]
26
33
  name = "autocfg"
27
34
  version = "1.1.0"
@@ -30,11 +37,11 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
30
37
 
31
38
  [[package]]
32
39
  name = "bindgen"
33
- version = "0.62.0"
40
+ version = "0.69.2"
34
41
  source = "registry+https://github.com/rust-lang/crates.io-index"
35
- checksum = "c6720a8b7b2d39dd533285ed438d458f65b31b5c257e6ac7bb3d7e82844dd722"
42
+ checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d"
36
43
  dependencies = [
37
- "bitflags 1.3.2",
44
+ "bitflags 2.4.2",
38
45
  "cexpr",
39
46
  "clang-sys",
40
47
  "lazy_static",
@@ -45,7 +52,7 @@ dependencies = [
45
52
  "regex",
46
53
  "rustc-hash",
47
54
  "shlex",
48
- "syn 1.0.109",
55
+ "syn",
49
56
  ]
50
57
 
51
58
  [[package]]
@@ -56,9 +63,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
56
63
 
57
64
  [[package]]
58
65
  name = "bitflags"
59
- version = "2.3.3"
66
+ version = "2.4.2"
60
67
  source = "registry+https://github.com/rust-lang/crates.io-index"
61
- checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42"
68
+ checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
62
69
 
63
70
  [[package]]
64
71
  name = "block-buffer"
@@ -71,21 +78,15 @@ dependencies = [
71
78
 
72
79
  [[package]]
73
80
  name = "bstr"
74
- version = "1.6.0"
81
+ version = "1.9.0"
75
82
  source = "registry+https://github.com/rust-lang/crates.io-index"
76
- checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05"
83
+ checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc"
77
84
  dependencies = [
78
85
  "memchr",
79
86
  "regex-automata",
80
87
  "serde",
81
88
  ]
82
89
 
83
- [[package]]
84
- name = "cc"
85
- version = "1.0.79"
86
- source = "registry+https://github.com/rust-lang/crates.io-index"
87
- checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
88
-
89
90
  [[package]]
90
91
  name = "cexpr"
91
92
  version = "0.6.0"
@@ -103,9 +104,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
103
104
 
104
105
  [[package]]
105
106
  name = "clang-sys"
106
- version = "1.6.1"
107
+ version = "1.7.0"
107
108
  source = "registry+https://github.com/rust-lang/crates.io-index"
108
- checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
109
+ checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1"
109
110
  dependencies = [
110
111
  "glob",
111
112
  "libc",
@@ -114,9 +115,9 @@ dependencies = [
114
115
 
115
116
  [[package]]
116
117
  name = "cpufeatures"
117
- version = "0.2.6"
118
+ version = "0.2.12"
118
119
  source = "registry+https://github.com/rust-lang/crates.io-index"
119
- checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181"
120
+ checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
120
121
  dependencies = [
121
122
  "libc",
122
123
  ]
@@ -143,23 +144,12 @@ dependencies = [
143
144
 
144
145
  [[package]]
145
146
  name = "errno"
146
- version = "0.3.2"
147
+ version = "0.3.8"
147
148
  source = "registry+https://github.com/rust-lang/crates.io-index"
148
- checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f"
149
+ checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
149
150
  dependencies = [
150
- "errno-dragonfly",
151
- "libc",
152
- "windows-sys",
153
- ]
154
-
155
- [[package]]
156
- name = "errno-dragonfly"
157
- version = "0.1.2"
158
- source = "registry+https://github.com/rust-lang/crates.io-index"
159
- checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
160
- dependencies = [
161
- "cc",
162
151
  "libc",
152
+ "windows-sys 0.52.0",
163
153
  ]
164
154
 
165
155
  [[package]]
@@ -186,9 +176,9 @@ dependencies = [
186
176
 
187
177
  [[package]]
188
178
  name = "fastrand"
189
- version = "2.0.0"
179
+ version = "2.0.1"
190
180
  source = "registry+https://github.com/rust-lang/crates.io-index"
191
- checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764"
181
+ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
192
182
 
193
183
  [[package]]
194
184
  name = "generic-array"
@@ -202,9 +192,9 @@ dependencies = [
202
192
 
203
193
  [[package]]
204
194
  name = "getrandom"
205
- version = "0.2.8"
195
+ version = "0.2.12"
206
196
  source = "registry+https://github.com/rust-lang/crates.io-index"
207
- checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
197
+ checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
208
198
  dependencies = [
209
199
  "cfg-if",
210
200
  "libc",
@@ -219,24 +209,25 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
219
209
 
220
210
  [[package]]
221
211
  name = "hashbrown"
222
- version = "0.13.2"
212
+ version = "0.14.3"
223
213
  source = "registry+https://github.com/rust-lang/crates.io-index"
224
- checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
214
+ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
225
215
  dependencies = [
226
216
  "ahash",
217
+ "allocator-api2",
227
218
  ]
228
219
 
229
220
  [[package]]
230
221
  name = "indoc"
231
- version = "2.0.3"
222
+ version = "2.0.4"
232
223
  source = "registry+https://github.com/rust-lang/crates.io-index"
233
- checksum = "2c785eefb63ebd0e33416dfcb8d6da0bf27ce752843a45632a67bf10d4d4b5c4"
224
+ checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8"
234
225
 
235
226
  [[package]]
236
227
  name = "itoa"
237
- version = "1.0.6"
228
+ version = "1.0.10"
238
229
  source = "registry+https://github.com/rust-lang/crates.io-index"
239
- checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
230
+ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
240
231
 
241
232
  [[package]]
242
233
  name = "lazy_static"
@@ -252,31 +243,31 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
252
243
 
253
244
  [[package]]
254
245
  name = "libc"
255
- version = "0.2.147"
246
+ version = "0.2.152"
256
247
  source = "registry+https://github.com/rust-lang/crates.io-index"
257
- checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
248
+ checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
258
249
 
259
250
  [[package]]
260
251
  name = "libloading"
261
- version = "0.7.4"
252
+ version = "0.8.1"
262
253
  source = "registry+https://github.com/rust-lang/crates.io-index"
263
- checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
254
+ checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161"
264
255
  dependencies = [
265
256
  "cfg-if",
266
- "winapi",
257
+ "windows-sys 0.48.0",
267
258
  ]
268
259
 
269
260
  [[package]]
270
261
  name = "linux-raw-sys"
271
- version = "0.4.3"
262
+ version = "0.4.13"
272
263
  source = "registry+https://github.com/rust-lang/crates.io-index"
273
- checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0"
264
+ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
274
265
 
275
266
  [[package]]
276
267
  name = "magnus"
277
- version = "0.6.0"
268
+ version = "0.6.2"
278
269
  source = "registry+https://github.com/rust-lang/crates.io-index"
279
- checksum = "68e9585bfe236e88e6b10b6d8eb5349bd0e0009f3f9dff8d2e99a82601b33743"
270
+ checksum = "4778544796676e8428e9c622460ebf284bea52d8b10db3aeb449d8b5e61b3a13"
280
271
  dependencies = [
281
272
  "magnus-macros",
282
273
  "rb-sys",
@@ -292,20 +283,20 @@ checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
292
283
  dependencies = [
293
284
  "proc-macro2",
294
285
  "quote",
295
- "syn 2.0.13",
286
+ "syn",
296
287
  ]
297
288
 
298
289
  [[package]]
299
290
  name = "memchr"
300
- version = "2.5.0"
291
+ version = "2.7.1"
301
292
  source = "registry+https://github.com/rust-lang/crates.io-index"
302
- checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
293
+ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
303
294
 
304
295
  [[package]]
305
296
  name = "memmap2"
306
- version = "0.5.10"
297
+ version = "0.9.3"
307
298
  source = "registry+https://github.com/rust-lang/crates.io-index"
308
- checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327"
299
+ checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92"
309
300
  dependencies = [
310
301
  "libc",
311
302
  ]
@@ -351,9 +342,9 @@ dependencies = [
351
342
 
352
343
  [[package]]
353
344
  name = "once_cell"
354
- version = "1.17.1"
345
+ version = "1.19.0"
355
346
  source = "registry+https://github.com/rust-lang/crates.io-index"
356
- checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
347
+ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
357
348
 
358
349
  [[package]]
359
350
  name = "peeking_take_while"
@@ -375,18 +366,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
375
366
 
376
367
  [[package]]
377
368
  name = "proc-macro2"
378
- version = "1.0.56"
369
+ version = "1.0.78"
379
370
  source = "registry+https://github.com/rust-lang/crates.io-index"
380
- checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
371
+ checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
381
372
  dependencies = [
382
373
  "unicode-ident",
383
374
  ]
384
375
 
385
376
  [[package]]
386
377
  name = "quote"
387
- version = "1.0.26"
378
+ version = "1.0.35"
388
379
  source = "registry+https://github.com/rust-lang/crates.io-index"
389
- checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
380
+ checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
390
381
  dependencies = [
391
382
  "proc-macro2",
392
383
  ]
@@ -423,18 +414,18 @@ dependencies = [
423
414
 
424
415
  [[package]]
425
416
  name = "rb-sys"
426
- version = "0.9.79"
417
+ version = "0.9.87"
427
418
  source = "registry+https://github.com/rust-lang/crates.io-index"
428
- checksum = "939fb78db3e4f26665c1d4c7b91ca66d3578335a19aba552d4a6445811d07072"
419
+ checksum = "225103e3d69bbfe8831f9fd0d2461335f3a9dd06aa6e88bcb6d6970383494d06"
429
420
  dependencies = [
430
421
  "rb-sys-build",
431
422
  ]
432
423
 
433
424
  [[package]]
434
425
  name = "rb-sys-build"
435
- version = "0.9.79"
426
+ version = "0.9.87"
436
427
  source = "registry+https://github.com/rust-lang/crates.io-index"
437
- checksum = "335a95eb0420d52fa94ef12019df3c2c250c6b19cbb3c60bd05cb7e9c362072c"
428
+ checksum = "bacce8095a5167d5ede618bbd9353e9d9e2f32ddaf54be911106f0ee6baacf09"
438
429
  dependencies = [
439
430
  "bindgen",
440
431
  "lazy_static",
@@ -442,7 +433,7 @@ dependencies = [
442
433
  "quote",
443
434
  "regex",
444
435
  "shell-words",
445
- "syn 1.0.109",
436
+ "syn",
446
437
  ]
447
438
 
448
439
  [[package]]
@@ -453,35 +444,41 @@ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
453
444
 
454
445
  [[package]]
455
446
  name = "redox_syscall"
456
- version = "0.3.5"
447
+ version = "0.4.1"
457
448
  source = "registry+https://github.com/rust-lang/crates.io-index"
458
- checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
449
+ checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
459
450
  dependencies = [
460
451
  "bitflags 1.3.2",
461
452
  ]
462
453
 
463
454
  [[package]]
464
455
  name = "regex"
465
- version = "1.7.3"
456
+ version = "1.10.3"
466
457
  source = "registry+https://github.com/rust-lang/crates.io-index"
467
- checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
458
+ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
468
459
  dependencies = [
469
460
  "aho-corasick",
470
461
  "memchr",
462
+ "regex-automata",
471
463
  "regex-syntax",
472
464
  ]
473
465
 
474
466
  [[package]]
475
467
  name = "regex-automata"
476
- version = "0.3.4"
468
+ version = "0.4.4"
477
469
  source = "registry+https://github.com/rust-lang/crates.io-index"
478
- checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294"
470
+ checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a"
471
+ dependencies = [
472
+ "aho-corasick",
473
+ "memchr",
474
+ "regex-syntax",
475
+ ]
479
476
 
480
477
  [[package]]
481
478
  name = "regex-syntax"
482
- version = "0.6.29"
479
+ version = "0.8.2"
483
480
  source = "registry+https://github.com/rust-lang/crates.io-index"
484
- checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
481
+ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
485
482
 
486
483
  [[package]]
487
484
  name = "rustc-hash"
@@ -491,54 +488,54 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
491
488
 
492
489
  [[package]]
493
490
  name = "rustix"
494
- version = "0.38.4"
491
+ version = "0.38.30"
495
492
  source = "registry+https://github.com/rust-lang/crates.io-index"
496
- checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5"
493
+ checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca"
497
494
  dependencies = [
498
- "bitflags 2.3.3",
495
+ "bitflags 2.4.2",
499
496
  "errno",
500
497
  "libc",
501
498
  "linux-raw-sys",
502
- "windows-sys",
499
+ "windows-sys 0.52.0",
503
500
  ]
504
501
 
505
502
  [[package]]
506
503
  name = "ryu"
507
- version = "1.0.13"
504
+ version = "1.0.16"
508
505
  source = "registry+https://github.com/rust-lang/crates.io-index"
509
- checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
506
+ checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
510
507
 
511
508
  [[package]]
512
509
  name = "seq-macro"
513
- version = "0.3.3"
510
+ version = "0.3.5"
514
511
  source = "registry+https://github.com/rust-lang/crates.io-index"
515
- checksum = "e6b44e8fc93a14e66336d230954dda83d18b4605ccace8fe09bc7514a71ad0bc"
512
+ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4"
516
513
 
517
514
  [[package]]
518
515
  name = "serde"
519
- version = "1.0.164"
516
+ version = "1.0.195"
520
517
  source = "registry+https://github.com/rust-lang/crates.io-index"
521
- checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d"
518
+ checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
522
519
  dependencies = [
523
520
  "serde_derive",
524
521
  ]
525
522
 
526
523
  [[package]]
527
524
  name = "serde_derive"
528
- version = "1.0.164"
525
+ version = "1.0.195"
529
526
  source = "registry+https://github.com/rust-lang/crates.io-index"
530
- checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
527
+ checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
531
528
  dependencies = [
532
529
  "proc-macro2",
533
530
  "quote",
534
- "syn 2.0.13",
531
+ "syn",
535
532
  ]
536
533
 
537
534
  [[package]]
538
535
  name = "serde_json"
539
- version = "1.0.99"
536
+ version = "1.0.111"
540
537
  source = "registry+https://github.com/rust-lang/crates.io-index"
541
- checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3"
538
+ checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
542
539
  dependencies = [
543
540
  "itoa",
544
541
  "ryu",
@@ -547,9 +544,9 @@ dependencies = [
547
544
 
548
545
  [[package]]
549
546
  name = "sha2"
550
- version = "0.10.7"
547
+ version = "0.10.8"
551
548
  source = "registry+https://github.com/rust-lang/crates.io-index"
552
- checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8"
549
+ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
553
550
  dependencies = [
554
551
  "cfg-if",
555
552
  "cpufeatures",
@@ -564,35 +561,24 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
564
561
 
565
562
  [[package]]
566
563
  name = "shlex"
567
- version = "1.1.0"
564
+ version = "1.3.0"
568
565
  source = "registry+https://github.com/rust-lang/crates.io-index"
569
- checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
566
+ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
570
567
 
571
568
  [[package]]
572
569
  name = "smallvec"
573
- version = "1.11.0"
570
+ version = "1.13.1"
574
571
  source = "registry+https://github.com/rust-lang/crates.io-index"
575
- checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9"
572
+ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
576
573
  dependencies = [
577
574
  "serde",
578
575
  ]
579
576
 
580
577
  [[package]]
581
578
  name = "syn"
582
- version = "1.0.109"
579
+ version = "2.0.48"
583
580
  source = "registry+https://github.com/rust-lang/crates.io-index"
584
- checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
585
- dependencies = [
586
- "proc-macro2",
587
- "quote",
588
- "unicode-ident",
589
- ]
590
-
591
- [[package]]
592
- name = "syn"
593
- version = "2.0.13"
594
- source = "registry+https://github.com/rust-lang/crates.io-index"
595
- checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec"
581
+ checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
596
582
  dependencies = [
597
583
  "proc-macro2",
598
584
  "quote",
@@ -601,48 +587,48 @@ dependencies = [
601
587
 
602
588
  [[package]]
603
589
  name = "tempfile"
604
- version = "3.7.0"
590
+ version = "3.9.0"
605
591
  source = "registry+https://github.com/rust-lang/crates.io-index"
606
- checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998"
592
+ checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa"
607
593
  dependencies = [
608
594
  "cfg-if",
609
595
  "fastrand",
610
596
  "redox_syscall",
611
597
  "rustix",
612
- "windows-sys",
598
+ "windows-sys 0.52.0",
613
599
  ]
614
600
 
615
601
  [[package]]
616
602
  name = "thiserror"
617
- version = "1.0.40"
603
+ version = "1.0.56"
618
604
  source = "registry+https://github.com/rust-lang/crates.io-index"
619
- checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac"
605
+ checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
620
606
  dependencies = [
621
607
  "thiserror-impl",
622
608
  ]
623
609
 
624
610
  [[package]]
625
611
  name = "thiserror-impl"
626
- version = "1.0.40"
612
+ version = "1.0.56"
627
613
  source = "registry+https://github.com/rust-lang/crates.io-index"
628
- checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
614
+ checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
629
615
  dependencies = [
630
616
  "proc-macro2",
631
617
  "quote",
632
- "syn 2.0.13",
618
+ "syn",
633
619
  ]
634
620
 
635
621
  [[package]]
636
622
  name = "typenum"
637
- version = "1.16.0"
623
+ version = "1.17.0"
638
624
  source = "registry+https://github.com/rust-lang/crates.io-index"
639
- checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
625
+ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
640
626
 
641
627
  [[package]]
642
628
  name = "unicode-ident"
643
- version = "1.0.8"
629
+ version = "1.0.12"
644
630
  source = "registry+https://github.com/rust-lang/crates.io-index"
645
- checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
631
+ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
646
632
 
647
633
  [[package]]
648
634
  name = "version_check"
@@ -657,89 +643,153 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
657
643
  checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
658
644
 
659
645
  [[package]]
660
- name = "winapi"
661
- version = "0.3.9"
646
+ name = "windows-sys"
647
+ version = "0.48.0"
662
648
  source = "registry+https://github.com/rust-lang/crates.io-index"
663
- checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
649
+ checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
664
650
  dependencies = [
665
- "winapi-i686-pc-windows-gnu",
666
- "winapi-x86_64-pc-windows-gnu",
651
+ "windows-targets 0.48.5",
667
652
  ]
668
653
 
669
654
  [[package]]
670
- name = "winapi-i686-pc-windows-gnu"
671
- version = "0.4.0"
672
- source = "registry+https://github.com/rust-lang/crates.io-index"
673
- checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
674
-
675
- [[package]]
676
- name = "winapi-x86_64-pc-windows-gnu"
677
- version = "0.4.0"
655
+ name = "windows-sys"
656
+ version = "0.52.0"
678
657
  source = "registry+https://github.com/rust-lang/crates.io-index"
679
- checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
658
+ checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
659
+ dependencies = [
660
+ "windows-targets 0.52.0",
661
+ ]
680
662
 
681
663
  [[package]]
682
- name = "windows-sys"
683
- version = "0.48.0"
664
+ name = "windows-targets"
665
+ version = "0.48.5"
684
666
  source = "registry+https://github.com/rust-lang/crates.io-index"
685
- checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
667
+ checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
686
668
  dependencies = [
687
- "windows-targets",
669
+ "windows_aarch64_gnullvm 0.48.5",
670
+ "windows_aarch64_msvc 0.48.5",
671
+ "windows_i686_gnu 0.48.5",
672
+ "windows_i686_msvc 0.48.5",
673
+ "windows_x86_64_gnu 0.48.5",
674
+ "windows_x86_64_gnullvm 0.48.5",
675
+ "windows_x86_64_msvc 0.48.5",
688
676
  ]
689
677
 
690
678
  [[package]]
691
679
  name = "windows-targets"
692
- version = "0.48.0"
680
+ version = "0.52.0"
693
681
  source = "registry+https://github.com/rust-lang/crates.io-index"
694
- checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
682
+ checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
695
683
  dependencies = [
696
- "windows_aarch64_gnullvm",
697
- "windows_aarch64_msvc",
698
- "windows_i686_gnu",
699
- "windows_i686_msvc",
700
- "windows_x86_64_gnu",
701
- "windows_x86_64_gnullvm",
702
- "windows_x86_64_msvc",
684
+ "windows_aarch64_gnullvm 0.52.0",
685
+ "windows_aarch64_msvc 0.52.0",
686
+ "windows_i686_gnu 0.52.0",
687
+ "windows_i686_msvc 0.52.0",
688
+ "windows_x86_64_gnu 0.52.0",
689
+ "windows_x86_64_gnullvm 0.52.0",
690
+ "windows_x86_64_msvc 0.52.0",
703
691
  ]
704
692
 
705
693
  [[package]]
706
694
  name = "windows_aarch64_gnullvm"
707
- version = "0.48.0"
695
+ version = "0.48.5"
696
+ source = "registry+https://github.com/rust-lang/crates.io-index"
697
+ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
698
+
699
+ [[package]]
700
+ name = "windows_aarch64_gnullvm"
701
+ version = "0.52.0"
708
702
  source = "registry+https://github.com/rust-lang/crates.io-index"
709
- checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
703
+ checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
710
704
 
711
705
  [[package]]
712
706
  name = "windows_aarch64_msvc"
713
- version = "0.48.0"
707
+ version = "0.48.5"
708
+ source = "registry+https://github.com/rust-lang/crates.io-index"
709
+ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
710
+
711
+ [[package]]
712
+ name = "windows_aarch64_msvc"
713
+ version = "0.52.0"
714
714
  source = "registry+https://github.com/rust-lang/crates.io-index"
715
- checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
715
+ checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
716
716
 
717
717
  [[package]]
718
718
  name = "windows_i686_gnu"
719
- version = "0.48.0"
719
+ version = "0.48.5"
720
720
  source = "registry+https://github.com/rust-lang/crates.io-index"
721
- checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
721
+ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
722
+
723
+ [[package]]
724
+ name = "windows_i686_gnu"
725
+ version = "0.52.0"
726
+ source = "registry+https://github.com/rust-lang/crates.io-index"
727
+ checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
722
728
 
723
729
  [[package]]
724
730
  name = "windows_i686_msvc"
725
- version = "0.48.0"
731
+ version = "0.48.5"
732
+ source = "registry+https://github.com/rust-lang/crates.io-index"
733
+ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
734
+
735
+ [[package]]
736
+ name = "windows_i686_msvc"
737
+ version = "0.52.0"
726
738
  source = "registry+https://github.com/rust-lang/crates.io-index"
727
- checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
739
+ checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
728
740
 
729
741
  [[package]]
730
742
  name = "windows_x86_64_gnu"
731
- version = "0.48.0"
743
+ version = "0.48.5"
732
744
  source = "registry+https://github.com/rust-lang/crates.io-index"
733
- checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
745
+ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
746
+
747
+ [[package]]
748
+ name = "windows_x86_64_gnu"
749
+ version = "0.52.0"
750
+ source = "registry+https://github.com/rust-lang/crates.io-index"
751
+ checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
734
752
 
735
753
  [[package]]
736
754
  name = "windows_x86_64_gnullvm"
737
- version = "0.48.0"
755
+ version = "0.48.5"
756
+ source = "registry+https://github.com/rust-lang/crates.io-index"
757
+ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
758
+
759
+ [[package]]
760
+ name = "windows_x86_64_gnullvm"
761
+ version = "0.52.0"
738
762
  source = "registry+https://github.com/rust-lang/crates.io-index"
739
- checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
763
+ checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
740
764
 
741
765
  [[package]]
742
766
  name = "windows_x86_64_msvc"
743
- version = "0.48.0"
767
+ version = "0.48.5"
768
+ source = "registry+https://github.com/rust-lang/crates.io-index"
769
+ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
770
+
771
+ [[package]]
772
+ name = "windows_x86_64_msvc"
773
+ version = "0.52.0"
744
774
  source = "registry+https://github.com/rust-lang/crates.io-index"
745
- checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
775
+ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
776
+
777
+ [[package]]
778
+ name = "zerocopy"
779
+ version = "0.7.32"
780
+ source = "registry+https://github.com/rust-lang/crates.io-index"
781
+ checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
782
+ dependencies = [
783
+ "zerocopy-derive",
784
+ ]
785
+
786
+ [[package]]
787
+ name = "zerocopy-derive"
788
+ version = "0.7.32"
789
+ source = "registry+https://github.com/rust-lang/crates.io-index"
790
+ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
791
+ dependencies = [
792
+ "proc-macro2",
793
+ "quote",
794
+ "syn",
795
+ ]
@@ -6,26 +6,26 @@ edition = "2021"
6
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
7
 
8
8
  [dependencies]
9
- hashbrown = "0.13"
9
+ hashbrown = "0.14"
10
10
  libc = "0.2"
11
11
  magnus = { version = "0.6", features = ["rb-sys"] }
12
- memmap2 = "0.5"
12
+ memmap2 = "0.9"
13
13
  # v0.26 cannot be built on CentOS 7 https://github.com/nix-rust/nix/issues/1972
14
14
  nix = { version = "0.25", features = ["mman"] } # mman used for MsFlags
15
- rb-sys = "0.9"
15
+ rb-sys = { version = "0.9", features = ["stable-api-compiled-fallback"] }
16
16
  serde = { version = "1.0", features = ["derive"] }
17
17
  serde_json = { version = "1.0", features = ["raw_value"] }
18
18
  smallvec = { version = "1.10", features = ["serde"] }
19
19
  thiserror = "1.0"
20
20
 
21
21
  [dev-dependencies]
22
- bstr = "1.6"
22
+ bstr = "1.9"
23
23
  indoc = "2.0"
24
24
  # We need the `embed` feature to run tests, but this triggers failures when building as a Gem.
25
25
  magnus = { version = "0.6", features = ["rb-sys","embed"] }
26
26
  rand = "0.8"
27
27
  sha2 = "0.10"
28
- tempfile = "3.5"
28
+ tempfile = "3.9"
29
29
 
30
30
  [build-dependencies]
31
31
  rb-sys-env = "0.1"
@@ -100,13 +100,6 @@ pub enum MmapError {
100
100
  /// No mmap open.
101
101
  #[error("unmapped file")]
102
102
  UnmappedFile,
103
- /// File length changed by another process.
104
- #[error("size of {path} {len} does not match previous size {expected_len}. Another process may have modified it.")]
105
- UnexpectedFileLength {
106
- path: String,
107
- len: usize,
108
- expected_len: usize,
109
- },
110
103
  /// A custom error message with `strerror(3)` appended.
111
104
  #[error("{0}")]
112
105
  WithErrno(String),
@@ -169,7 +162,6 @@ impl MmapError {
169
162
  MmapError::Other(_) => RubyError::Arg,
170
163
  MmapError::PromParsing(_) => RubyError::PromParsing,
171
164
  MmapError::UnmappedFile => RubyError::Io,
172
- MmapError::UnexpectedFileLength { .. } => RubyError::Runtime,
173
165
  MmapError::WithErrno(_) => RubyError::Io,
174
166
  }
175
167
  }
@@ -5,7 +5,7 @@ use std::fs::File;
5
5
  use std::mem::size_of;
6
6
  use std::ops::Range;
7
7
  use std::os::unix::prelude::{AsRawFd, RawFd};
8
- use std::path::{Path, PathBuf};
8
+ use std::path::PathBuf;
9
9
 
10
10
  use crate::error::{MmapError, RubyError};
11
11
  use crate::raw_entry::RawEntry;
@@ -34,8 +34,6 @@ pub(super) struct InnerMmap {
34
34
  ///
35
35
  /// Equivalent to `i_mm->t->real` in the C implementation.
36
36
  len: usize,
37
- /// The length of the file being mmapped at the time of mapping.
38
- file_len: usize,
39
37
  }
40
38
 
41
39
  impl InnerMmap {
@@ -43,12 +41,19 @@ impl InnerMmap {
43
41
  /// Use when mmapping a file for the first time. When re-mapping a file
44
42
  /// after expanding it the `reestablish` function should be used.
45
43
  pub fn new(path: PathBuf, file: File) -> Result<Self> {
46
- let initial_file_len = get_file_len(&path, &file)?;
44
+ let stat = file.metadata().map_err(|e| {
45
+ MmapError::legacy(
46
+ format!("Can't stat {}: {e}", path.display()),
47
+ RubyError::Arg,
48
+ )
49
+ })?;
50
+
51
+ let file_size = util::cast_chk::<_, usize>(stat.len(), "file length")?;
47
52
 
48
53
  // We need to ensure the underlying file descriptor is at least a page size.
49
54
  // Otherwise, we could get a SIGBUS error if mmap() attempts to read or write
50
55
  // past the file.
51
- let reserve_size = Self::next_page_boundary(initial_file_len)?;
56
+ let reserve_size = Self::next_page_boundary(file_size)?;
52
57
 
53
58
  // Cast: no-op.
54
59
  Self::reserve_mmap_file_bytes(file.as_raw_fd(), reserve_size as off_t).map_err(|e| {
@@ -62,23 +67,21 @@ impl InnerMmap {
62
67
  })?;
63
68
 
64
69
  // Ensure we always have space for the header.
65
- let map_len = initial_file_len.max(HEADER_SIZE);
70
+ let map_len = file_size.max(HEADER_SIZE);
66
71
 
67
72
  // SAFETY: There is the possibility of UB if the file is modified outside of
68
73
  // this program.
69
74
  let map = unsafe { MmapOptions::new().len(map_len).map_mut(&file) }.map_err(|e| {
70
75
  MmapError::legacy(format!("mmap failed ({}): {e}", errno()), RubyError::Arg)
71
76
  })?;
72
- let file_len = util::cast_chk::<_, usize>(reserve_size, "file length")?;
73
77
 
74
- let len = initial_file_len;
78
+ let len = file_size;
75
79
 
76
80
  Ok(Self {
77
81
  file,
78
82
  path,
79
83
  map,
80
84
  len,
81
- file_len,
82
85
  })
83
86
  }
84
87
 
@@ -94,14 +97,12 @@ impl InnerMmap {
94
97
  // to the old length at this point if closing the file. Matching C implementation
95
98
  // for now.
96
99
  let len = map_len;
97
- let file_len = get_file_len(&path, &file)?;
98
100
 
99
101
  Ok(Self {
100
102
  file,
101
103
  path,
102
104
  map,
103
105
  len,
104
- file_len,
105
106
  })
106
107
  }
107
108
 
@@ -185,7 +186,7 @@ impl InnerMmap {
185
186
  self.len
186
187
  }
187
188
 
188
- /// The total length in bytes of the mmapped region of the file.
189
+ /// The total length in bytes of the mmapped file.
189
190
  ///
190
191
  /// Equivalent to `i_mm->t->len` in the C implementation.
191
192
  #[inline]
@@ -193,21 +194,6 @@ impl InnerMmap {
193
194
  self.map.len()
194
195
  }
195
196
 
196
- /// `stat` the mmapped file and return its length.
197
- pub fn check_file_len(&self) -> Result<usize> {
198
- get_file_len(&self.path, &self.file)
199
- }
200
-
201
- /// The length of the file at the time it was mmapped.
202
- pub fn file_len(&self) -> usize {
203
- self.file_len
204
- }
205
-
206
- /// The path of the mmapped file.
207
- pub fn path(&self) -> String {
208
- self.path.to_string_lossy().to_string()
209
- }
210
-
211
197
  /// Update the length of the mmap considered to be written.
212
198
  pub fn set_len(&mut self, len: usize) {
213
199
  self.len = len;
@@ -326,17 +312,6 @@ impl InnerMmap {
326
312
  }
327
313
  }
328
314
 
329
- fn get_file_len(path: &Path, file: &File) -> Result<usize> {
330
- let stat = file.metadata().map_err(|e| {
331
- MmapError::legacy(
332
- format!("Can't stat {}: {e}", path.display()),
333
- RubyError::Arg,
334
- )
335
- })?;
336
-
337
- util::cast_chk::<_, usize>(stat.len(), "file length")
338
- }
339
-
340
315
  #[cfg(test)]
341
316
  mod test {
342
317
  use nix::unistd::{self, SysconfVar};
@@ -441,49 +441,17 @@ impl MmapedFile {
441
441
  }
442
442
 
443
443
  /// Check that the mmap is large enough to contain the value to be added,
444
- /// and expand it to fit if necessary. Will return an error if the file
445
- /// has been resized by another process.
444
+ /// and expand it to fit if necessary.
446
445
  fn check_expand(&self, rb_self: Obj<Self>, key_len: usize) -> magnus::error::Result<()> {
447
446
  // CAST: no-op on 32-bit, widening on 64-bit.
448
447
  let used = self.inner(|inner| inner.load_used())? as usize;
449
448
  let entry_len = RawEntry::calc_total_len(key_len)?;
450
- let required_len = used.add_chk(entry_len)?;
451
- let mut target_cap = self.capacity();
452
449
 
453
- let mut needs_resize = false;
454
450
  // We need the mmapped region to contain at least one byte beyond the
455
- // written data to create a NUL-terminated C string. Validate that
456
- // new length does not exactly match the length of the mmap.
457
- if target_cap <= required_len {
458
- needs_resize = true;
459
- target_cap = required_len + 1;
460
- }
461
-
462
- let (current_file_len, original_file_len) =
463
- self.inner(|inner| Ok((inner.check_file_len()?, inner.file_len())))?;
464
-
465
- let file_modified = current_file_len != original_file_len;
466
- if file_modified {
467
- // Ensure our new capacity is at least as large as the actual file.
468
- // Erroring out without first resizing the mmap would leave us stuck
469
- // in a bad state.
470
- target_cap = current_file_len
471
- }
472
-
473
- if needs_resize {
474
- self.expand_to_fit(rb_self, target_cap)?;
475
- }
476
-
477
- if file_modified {
478
- // Return an error so the caller is alerted that there were concurrent writes to the
479
- // file.
480
- let path = self.inner(|inner| Ok(inner.path()))?;
481
- return Err(MmapError::UnexpectedFileLength {
482
- path,
483
- len: current_file_len,
484
- expected_len: original_file_len,
485
- }
486
- .into());
451
+ // written data to create a NUL- terminated C string. Validate that
452
+ // new length does not exactly match or exceed the length of the mmap.
453
+ while self.capacity() <= used.add_chk(entry_len)? {
454
+ self.expand_to_fit(rb_self, self.capacity().mul_chk(2)?)?;
487
455
  }
488
456
 
489
457
  Ok(())
@@ -684,7 +652,6 @@ mod test {
684
652
  use super::*;
685
653
  use crate::raw_entry::RawEntry;
686
654
  use crate::testhelper::TestFile;
687
- use std::os::unix::prelude::AsRawFd;
688
655
 
689
656
  /// Create a wrapped MmapedFile object.
690
657
  fn create_obj() -> Obj<MmapedFile> {
@@ -914,37 +881,4 @@ mod test {
914
881
  // Validate that we have expanded the mmap, ensuring a trailing NUL.
915
882
  assert!(rs_self.capacity() > current_cap);
916
883
  }
917
-
918
- #[test]
919
- fn test_detect_external_resize() {
920
- let _cleanup = unsafe { magnus::embed::init() };
921
- let ruby = magnus::Ruby::get().unwrap();
922
- crate::init(&ruby).unwrap();
923
-
924
- let TestFile {
925
- file,
926
- path,
927
- dir: _dir,
928
- } = TestFile::new(&[0u8; 8]);
929
-
930
- let path_str = path.display().to_string();
931
- let rpath = RString::new(&path_str);
932
-
933
- // Object created successfully
934
- let result: std::result::Result<Obj<MmapedFile>, Error> =
935
- eval!("FastMmapedFileRs.new(path)", path = rpath);
936
- assert!(result.is_ok());
937
- let obj = result.unwrap();
938
-
939
- let rs_self = &*obj;
940
-
941
- let file_len = 1 << 32;
942
- nix::unistd::ftruncate(file.as_raw_fd(), file_len).unwrap();
943
-
944
- // We error when the file is externally modified.
945
- assert!(rs_self.check_expand(obj, 512).is_err());
946
-
947
- // We updated the object to use the new size.
948
- assert_eq!(rs_self.capacity(), file_len as usize);
949
- }
950
884
  }
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  module Prometheus
2
2
  module Client
3
- VERSION = '1.0.3'.freeze
3
+ VERSION = '1.1.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus-client-mmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.1
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Tobias Schmidt
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-01-02 00:00:00.000000000 Z
14
+ date: 2024-01-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rb_sys
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: '0.9'
22
+ version: 0.9.86
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.9'
29
+ version: 0.9.86
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: fuzzbert
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -95,14 +95,14 @@ dependencies:
95
95
  requirements:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: 1.3.0
98
+ version: 1.4.0
99
99
  type: :development
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: 1.3.0
105
+ version: 1.4.0
106
106
  - !ruby/object:Gem::Dependency
107
107
  name: ruby-prof
108
108
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,7 @@ files:
150
150
  - lib/3.0/fast_mmaped_file_rs.bundle
151
151
  - lib/3.1/fast_mmaped_file_rs.bundle
152
152
  - lib/3.2/fast_mmaped_file_rs.bundle
153
+ - lib/3.3/fast_mmaped_file_rs.bundle
153
154
  - lib/prometheus.rb
154
155
  - lib/prometheus/client.rb
155
156
  - lib/prometheus/client/configuration.rb
@@ -194,7 +195,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
195
  version: '2.7'
195
196
  - - "<"
196
197
  - !ruby/object:Gem::Version
197
- version: 3.3.dev
198
+ version: 3.4.dev
198
199
  required_rubygems_version: !ruby/object:Gem::Requirement
199
200
  requirements:
200
201
  - - ">="