prometheus-client-mmap 0.22.0-x86_64-linux → 0.23.1-x86_64-linux
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/.tool-versions +1 -0
 - data/ext/fast_mmaped_file_rs/src/mmap.rs +6 -6
 - data/lib/2.7/fast_mmaped_file_rs.so +0 -0
 - data/lib/3.0/fast_mmaped_file_rs.so +0 -0
 - data/lib/3.1/fast_mmaped_file_rs.so +0 -0
 - data/lib/3.2/fast_mmaped_file_rs.so +0 -0
 - data/lib/prometheus/client/version.rb +1 -1
 - metadata +4 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 6851bfe2f20cf4e94e5c6a92a6e569a0183b484432a4cd8ff91c15ade5525776
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 04231401f2c519bb0fbfd31518c9eb92cfc40413da1130ed0d38902f01ca46f8
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 79f9ac6cee32f034c6fdc7e87ccf9f60eed68bee3caf1605e8902e423a58ad9ada814fda776d699dd17661e33ca550ab6ca7bdc401e6aefe107e7e0a270f32cc
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 269f8762fbf9732d2513b8d14d64e2dc35fe936118e9ba0456570ca815e0f9446ec7d187225c24ace252187a8d0d58fde4d901b4a9e90843ee8faba9b9422e3f
         
     | 
    
        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  
     | 
| 
       359 
     | 
    
         
            -
                ///  
     | 
| 
      
 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::<_,  
     | 
| 
      
 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 
     | 
| 
       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 
     | 
    
         
             
                    }
         
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.23.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: x86_64-linux
         
     | 
| 
       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- 
     | 
| 
      
 14 
     | 
    
         
            +
            date: 2023-05-02 00:00:00.000000000 Z
         
     | 
| 
       15 
15 
     | 
    
         
             
            dependencies:
         
     | 
| 
       16 
16 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       17 
17 
     | 
    
         
             
              name: rb_sys
         
     | 
| 
         @@ -127,6 +127,7 @@ executables: [] 
     | 
|
| 
       127 
127 
     | 
    
         
             
            extensions: []
         
     | 
| 
       128 
128 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       129 
129 
     | 
    
         
             
            files:
         
     | 
| 
      
 130 
     | 
    
         
            +
            - ".tool-versions"
         
     | 
| 
       130 
131 
     | 
    
         
             
            - README.md
         
     | 
| 
       131 
132 
     | 
    
         
             
            - ext/fast_mmaped_file/extconf.rb
         
     | 
| 
       132 
133 
     | 
    
         
             
            - ext/fast_mmaped_file/fast_mmaped_file.c
         
     | 
| 
         @@ -238,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       238 
239 
     | 
    
         
             
              requirements:
         
     | 
| 
       239 
240 
     | 
    
         
             
              - - ">="
         
     | 
| 
       240 
241 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       241 
     | 
    
         
            -
                  version:  
     | 
| 
      
 242 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
       242 
243 
     | 
    
         
             
            requirements: []
         
     | 
| 
       243 
244 
     | 
    
         
             
            rubygems_version: 3.4.4
         
     | 
| 
       244 
245 
     | 
    
         
             
            signing_key: 
         
     |