https://github.com/RazrFalcon/memmap2-rs
This is a fork of the original memmap crate which appears to be unmaintained:
https://github.com/danburkert/memmap-rs/issues/90
This fork is the most popular according to https://crates.io/keywords/mmap
( )
Alphare |
hg-reviewers |
https://github.com/RazrFalcon/memmap2-rs
This is a fork of the original memmap crate which appears to be unmaintained:
https://github.com/danburkert/memmap-rs/issues/90
This fork is the most popular according to https://crates.io/keywords/mmap
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | rust/Cargo.lock (9 lines) | |||
M | rust/hg-core/Cargo.toml (2 lines) | |||
M | rust/hg-core/examples/nodemap/index.rs (2 lines) | |||
M | rust/hg-core/examples/nodemap/main.rs (2 lines) | |||
M | rust/hg-core/src/revlog/nodemap_docket.rs (2 lines) | |||
M | rust/hg-core/src/vfs.rs (2 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin |
"derive_more", | "derive_more", | ||||
"flate2", | "flate2", | ||||
"format-bytes", | "format-bytes", | ||||
"home", | "home", | ||||
"im-rc", | "im-rc", | ||||
"itertools", | "itertools", | ||||
"lazy_static", | "lazy_static", | ||||
"log", | "log", | ||||
"memmap", | "memmap2", | ||||
"micro-timer", | "micro-timer", | ||||
"pretty_assertions", | "pretty_assertions", | ||||
"rand", | "rand", | ||||
"rand_distr", | "rand_distr", | ||||
"rand_pcg", | "rand_pcg", | ||||
"rayon", | "rayon", | ||||
"regex", | "regex", | ||||
"same-file", | "same-file", | ||||
[[package]] | [[package]] | ||||
name = "memchr" | name = "memchr" | ||||
version = "2.3.4" | version = "2.3.4" | ||||
source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" | checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" | ||||
[[package]] | [[package]] | ||||
name = "memmap" | name = "memmap2" | ||||
version = "0.7.0" | version = "0.3.1" | ||||
source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" | checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" | ||||
dependencies = [ | dependencies = [ | ||||
"libc", | "libc", | ||||
"winapi", | |||||
] | ] | ||||
[[package]] | [[package]] | ||||
name = "memoffset" | name = "memoffset" | ||||
version = "0.6.1" | version = "0.6.1" | ||||
source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" | checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" | ||||
dependencies = [ | dependencies = [ |
sha-1 = "0.9.6" | sha-1 = "0.9.6" | ||||
twox-hash = "1.5.0" | twox-hash = "1.5.0" | ||||
same-file = "1.0.6" | same-file = "1.0.6" | ||||
stable_deref_trait = "1.2.0" | stable_deref_trait = "1.2.0" | ||||
tempfile = "3.1.0" | tempfile = "3.1.0" | ||||
crossbeam-channel = "0.4" | crossbeam-channel = "0.4" | ||||
micro-timer = "0.3.0" | micro-timer = "0.3.0" | ||||
log = "0.4.8" | log = "0.4.8" | ||||
memmap = "0.7.0" | memmap2 = "0.3.1" | ||||
zstd = "0.5.3" | zstd = "0.5.3" | ||||
format-bytes = "0.2.2" | format-bytes = "0.2.2" | ||||
# We don't use the `miniz-oxide` backend to not change rhg benchmarks and until | # We don't use the `miniz-oxide` backend to not change rhg benchmarks and until | ||||
# we have a clearer view of which backend is the fastest. | # we have a clearer view of which backend is the fastest. | ||||
[dependencies.flate2] | [dependencies.flate2] | ||||
version = "1.0.16" | version = "1.0.16" | ||||
features = ["zlib"] | features = ["zlib"] | ||||
default-features = false | default-features = false | ||||
[dev-dependencies] | [dev-dependencies] | ||||
clap = "*" | clap = "*" | ||||
pretty_assertions = "0.6.1" | pretty_assertions = "0.6.1" |
// Copyright 2019-2020 Georges Racinet <georges.racinet@octobus.net> | // Copyright 2019-2020 Georges Racinet <georges.racinet@octobus.net> | ||||
// | // | ||||
// This software may be used and distributed according to the terms of the | // This software may be used and distributed according to the terms of the | ||||
// GNU General Public License version 2 or any later version. | // GNU General Public License version 2 or any later version. | ||||
//! Minimal `RevlogIndex`, readable from standard Mercurial file format | //! Minimal `RevlogIndex`, readable from standard Mercurial file format | ||||
use hg::*; | use hg::*; | ||||
use memmap::*; | use memmap2::*; | ||||
use std::fs::File; | use std::fs::File; | ||||
use std::ops::Deref; | use std::ops::Deref; | ||||
use std::path::Path; | use std::path::Path; | ||||
use std::slice; | use std::slice; | ||||
pub struct Index { | pub struct Index { | ||||
data: Box<dyn Deref<Target = [IndexEntry]> + Send>, | data: Box<dyn Deref<Target = [IndexEntry]> + Send>, | ||||
} | } |
// Copyright 2019-2020 Georges Racinet <georges.racinet@octobus.net> | // Copyright 2019-2020 Georges Racinet <georges.racinet@octobus.net> | ||||
// | // | ||||
// This software may be used and distributed according to the terms of the | // This software may be used and distributed according to the terms of the | ||||
// GNU General Public License version 2 or any later version. | // GNU General Public License version 2 or any later version. | ||||
use clap::*; | use clap::*; | ||||
use hg::revlog::node::*; | use hg::revlog::node::*; | ||||
use hg::revlog::nodemap::*; | use hg::revlog::nodemap::*; | ||||
use hg::revlog::*; | use hg::revlog::*; | ||||
use memmap::MmapOptions; | use memmap2::MmapOptions; | ||||
use rand::Rng; | use rand::Rng; | ||||
use std::fs::File; | use std::fs::File; | ||||
use std::io; | use std::io; | ||||
use std::io::Write; | use std::io::Write; | ||||
use std::path::{Path, PathBuf}; | use std::path::{Path, PathBuf}; | ||||
use std::str::FromStr; | use std::str::FromStr; | ||||
use std::time::Instant; | use std::time::Instant; | ||||
use crate::errors::{HgError, HgResultExt}; | use crate::errors::{HgError, HgResultExt}; | ||||
use crate::requirements; | use crate::requirements; | ||||
use bytes_cast::{unaligned, BytesCast}; | use bytes_cast::{unaligned, BytesCast}; | ||||
use memmap::Mmap; | use memmap2::Mmap; | ||||
use std::path::{Path, PathBuf}; | use std::path::{Path, PathBuf}; | ||||
use super::revlog::RevlogError; | use super::revlog::RevlogError; | ||||
use crate::repo::Repo; | use crate::repo::Repo; | ||||
use crate::utils::strip_suffix; | use crate::utils::strip_suffix; | ||||
const ONDISK_VERSION: u8 = 1; | const ONDISK_VERSION: u8 = 1; | ||||
use crate::errors::{HgError, IoErrorContext, IoResultExt}; | use crate::errors::{HgError, IoErrorContext, IoResultExt}; | ||||
use memmap::{Mmap, MmapOptions}; | use memmap2::{Mmap, MmapOptions}; | ||||
use std::io::ErrorKind; | use std::io::ErrorKind; | ||||
use std::path::{Path, PathBuf}; | use std::path::{Path, PathBuf}; | ||||
/// Filesystem access abstraction for the contents of a given "base" diretory | /// Filesystem access abstraction for the contents of a given "base" diretory | ||||
#[derive(Clone, Copy)] | #[derive(Clone, Copy)] | ||||
pub struct Vfs<'a> { | pub struct Vfs<'a> { | ||||
pub(crate) base: &'a Path, | pub(crate) base: &'a Path, | ||||
} | } |