prometheus-client-mmap 0.22.0 → 0.23.1

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: 76620d3673fbd59823bfe6a65452f5c447f3def2392d85db468dd26b98cf9192
4
- data.tar.gz: 95ade04c3c94979f955675e0b3d556426c36edc56eeb697c7fd5c655f8deec35
3
+ metadata.gz: 3125bbd60563b936ffa17d09e8e580e8120d0e3b55d9cc1a88c8bbcdce1e3f89
4
+ data.tar.gz: e682ce4a96d84a7ca4587853044574e93df02003d71714179b0777a555656eb6
5
5
  SHA512:
6
- metadata.gz: 366ab0b658d1e2f620ac89abbc1c56956af05d5de2e4773d11f7ba408bd9fb6e30584053043a6822a74c51cacecdd58320642a2fb0d4438146a10fd0323d67b7
7
- data.tar.gz: 796f85c19e6791742716f1c03cc7744ad9dffb11e688cc5273ed64a9a9230f916a2c12f45c17b09543145e27e6249b597c2a101f7eed6007f6e0f13ef9398026
6
+ metadata.gz: 75c5deb43e465930c58eb0c494df46ffb81674bd8cb2540b5cd99f4ad87a0eb4bd5daeadbc5277b93d8455c2613b45c03f7f916db52c206727040f1f6ef35129
7
+ data.tar.gz: b7d404084d86a1795d52757683de4c35ece4241e5c847b3e2939cdf91020e114337e37bad85775761f7303b199e0a2df62d854b0e0a5b8476d68dc0b736d0490
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ rust 1.65.0
@@ -4,6 +4,7 @@ use magnus::rb_sys::{AsRawValue, FromRawValue};
4
4
  use magnus::typed_data::Obj;
5
5
  use magnus::value::Fixnum;
6
6
  use magnus::{block::Proc, eval, scan_args, Error, Integer, RArray, RClass, RHash, RString, Value};
7
+ use nix::libc::c_long;
7
8
  use rb_sys::rb_str_new_static;
8
9
  use std::fs::File;
9
10
  use std::io::{prelude::*, SeekFrom};
@@ -336,7 +337,7 @@ impl MmapedFile {
336
337
 
337
338
  // SAFETY: This is safe so long as the data provided to Ruby meets its
338
339
  // requirements. When unmapping the file this will no longer be the
339
- // case, see the comment on `munmap` how we handle this.
340
+ // case, see the comment on `munmap` for how we handle this.
340
341
  Ok(unsafe { rb_str_new_static(ptr as _, len as _) })
341
342
  })?;
342
343
 
@@ -355,15 +356,15 @@ impl MmapedFile {
355
356
  }
356
357
 
357
358
  /// If we reallocate, any live Ruby strings provided by the `str()` method
358
- /// will be will be invalidated. We need to iterate over them using and
359
- /// update their heap pointers to the newly allocated memory region.
359
+ /// will be invalidated. We need to iterate over them using and update their
360
+ /// heap pointers to the newly allocated memory region.
360
361
  fn update_weak_map(&self, rb_self: Obj<Self>) -> magnus::error::Result<()> {
361
362
  let tracker: Value = rb_self.ivar_get("@weak_obj_tracker")?;
362
363
 
363
364
  let (new_ptr, new_len) = (*rb_self).inner(|inner| {
364
365
  // Pointers are not `Send`, convert it to usize to allow capture in closure.
365
366
  let new_ptr = inner.as_ptr() as usize;
366
- let new_len = util::cast_chk::<_, i64>(inner.len(), "mmap len")?;
367
+ let new_len = util::cast_chk::<_, c_long>(inner.len(), "mmap len")?;
367
368
 
368
369
  Ok((new_ptr, new_len))
369
370
  })?;
@@ -406,8 +407,7 @@ impl MmapedFile {
406
407
 
407
408
  // We need the mmapped region to contain at least one byte beyond the
408
409
  // written data to create a NUL- terminated C string. Validate that
409
- // new length does not exactly match the length of the mmap or exceed
410
- // it.
410
+ // new length does not exactly match or exceed the length of the mmap.
411
411
  while self.capacity() <= used.add_chk(entry_len)? {
412
412
  self.expand_to_fit(rb_self, self.capacity().mul_chk(2)?)?;
413
413
  }
@@ -1,5 +1,5 @@
1
1
  module Prometheus
2
2
  module Client
3
- VERSION = '0.22.0'.freeze
3
+ VERSION = '0.23.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: 0.22.0
4
+ version: 0.23.1
5
5
  platform: ruby
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: 2023-04-28 00:00:00.000000000 Z
14
+ date: 2023-05-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rb_sys
@@ -129,6 +129,7 @@ extensions:
129
129
  - ext/fast_mmaped_file_rs/extconf.rb
130
130
  extra_rdoc_files: []
131
131
  files:
132
+ - ".tool-versions"
132
133
  - README.md
133
134
  - ext/fast_mmaped_file/extconf.rb
134
135
  - ext/fast_mmaped_file/fast_mmaped_file.c
@@ -229,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
230
  requirements:
230
231
  - - ">="
231
232
  - !ruby/object:Gem::Version
232
- version: 3.3.22
233
+ version: '0'
233
234
  requirements: []
234
235
  rubygems_version: 3.3.26
235
236
  signing_key: