From a990de90fe41456a23e58bd087d2f107d321f3a1 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 19 Jul 2024 16:37:58 +0400 Subject: Deleted vendor folder --- .../backtrace/src/symbolize/gimli/mmap_windows.rs | 57 ---------------------- 1 file changed, 57 deletions(-) delete mode 100644 vendor/backtrace/src/symbolize/gimli/mmap_windows.rs (limited to 'vendor/backtrace/src/symbolize/gimli/mmap_windows.rs') diff --git a/vendor/backtrace/src/symbolize/gimli/mmap_windows.rs b/vendor/backtrace/src/symbolize/gimli/mmap_windows.rs deleted file mode 100644 index b39509d..0000000 --- a/vendor/backtrace/src/symbolize/gimli/mmap_windows.rs +++ /dev/null @@ -1,57 +0,0 @@ -use super::super::super::windows::*; -use super::mystd::fs::File; -use super::mystd::os::windows::prelude::*; -use core::ops::Deref; -use core::ptr; -use core::slice; - -pub struct Mmap { - // keep the file alive to prevent it from being deleted which would cause - // us to read bad data. - _file: File, - ptr: *mut c_void, - len: usize, -} - -impl Mmap { - pub unsafe fn map(file: &File, len: usize) -> Option { - let file = file.try_clone().ok()?; - let mapping = CreateFileMappingA( - file.as_raw_handle() as *mut _, - ptr::null_mut(), - PAGE_READONLY, - 0, - 0, - ptr::null(), - ); - if mapping.is_null() { - return None; - } - let ptr = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, len); - CloseHandle(mapping); - if ptr.is_null() { - return None; - } - Some(Mmap { - _file: file, - ptr, - len, - }) - } -} -impl Deref for Mmap { - type Target = [u8]; - - fn deref(&self) -> &[u8] { - unsafe { slice::from_raw_parts(self.ptr as *const u8, self.len) } - } -} - -impl Drop for Mmap { - fn drop(&mut self) { - unsafe { - let r = UnmapViewOfFile(self.ptr); - debug_assert!(r != 0); - } - } -} -- cgit v1.2.3