From d4c0d3d82c0cfaa68aa6c593f3d42fa1e74ecab8 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 21 Jun 2023 10:23:37 +0200 Subject: [PATCH 1/3] Fork crate as `shared_memory_extended` There was no reaction on https://github.com/elast0ny/shared_memory/pull/100 for multiple months, so we decided to create a fork for now. --- Cargo.toml | 10 +++++----- README.md | 8 ++++---- examples/basic.rs | 2 +- examples/event.rs | 2 +- examples/mutex.rs | 2 +- src/lib.rs | 2 +- tests/general.rs | 2 +- tests/posix_semantics.rs | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b6dd3e4..87eaea7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "shared_memory" +name = "shared_memory_extended" description = "A user friendly crate that allows you to share memory between processes" -version = "0.12.5" +version = "0.13.0" authors = ["ElasT0ny "] license = "MIT OR Apache-2.0" edition = "2018" #Extra fields for crates.io readme = "README.md" -documentation = "https://docs.rs/shared_memory" -repository = "https://github.com/elast0ny/shared_memory-rs" +documentation = "https://docs.rs/shared_memory_extended" +repository = "https://github.com/phil-opp/shared_memory" keywords = ["shmem", "shared", "memory", "inter-process", "process"] categories = [ "os::unix-apis", @@ -39,5 +39,5 @@ win-sys = "0.3" [dev-dependencies] raw_sync = "0.1" -clap = {version = "4", features = ["derive"]} +clap = { version = "4", features = ["derive"] } env_logger = "0" diff --git a/README.md b/README.md index cb2ce44..0414286 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# shared_memory -[![Build Status](https://github.com/elast0ny/shared_memory-rs/workflows/build/badge.svg)](https://github.com/elast0ny/shared_memory-rs/actions?query=workflow%3Abuild) +# shared_memory_extended +[![Build Status](https://github.com/phil-opp/shared_memory/workflows/build/badge.svg)](https://github.com/phil-opp/shared_memory/actions?query=workflow%3Abuild) [![crates.io](https://img.shields.io/crates/v/shared_memory.svg)](https://crates.io/crates/shared_memory) [![mio](https://docs.rs/shared_memory/badge.svg)](https://docs.rs/shared_memory/) -[![Lines of Code](https://tokei.rs/b1/github/elast0ny/shared_memory-rs?category=code)](https://tokei.rs/b1/github/elast0ny/shared_memory-rs?category=code) +[![Lines of Code](https://tokei.rs/b1/github/phil-opp/shared_memory?category=code)](https://tokei.rs/b1/github/phil-opp/shared_memory?category=code) -A crate that allows you to share memory between __processes__. +A crate that allows you to share memory between __processes__. Fork of [elast0ny/shared_memory](https://github.com/elast0ny/shared_memory). This crate provides lightweight wrappers around shared memory APIs in an OS agnostic way. It is intended to be used with it's sister crate [raw_sync](https://github.com/elast0ny/raw_sync-rs) which provide simple primitves to synchronize access to the shared memory (Mutex, RwLock, Events, etc...). diff --git a/examples/basic.rs b/examples/basic.rs index 29a2c39..22ba5ba 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -1,7 +1,7 @@ use std::thread; use clap::Parser; -use shared_memory::*; +use shared_memory_extended::*; /// Spawns N threads that increment a value to 100 #[derive(Parser)] diff --git a/examples/event.rs b/examples/event.rs index 97162c6..4c7121f 100644 --- a/examples/event.rs +++ b/examples/event.rs @@ -1,5 +1,5 @@ use raw_sync::{events::*, Timeout}; -use shared_memory::*; +use shared_memory_extended::*; fn main() -> Result<(), Box> { env_logger::init(); diff --git a/examples/mutex.rs b/examples/mutex.rs index dbf60df..7c0b9e1 100644 --- a/examples/mutex.rs +++ b/examples/mutex.rs @@ -3,7 +3,7 @@ use std::thread; use clap::Parser; use raw_sync::locks::*; -use shared_memory::*; +use shared_memory_extended::*; /// Spawns N threads that increment a value to 10 using a mutex #[derive(Parser)] diff --git a/src/lib.rs b/src/lib.rs index 3f05937..3b76858 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ //! A thin wrapper around shared memory system calls //! -//! For help on how to get started, take a look at the [examples](https://github.com/elast0ny/shared_memory-rs/tree/master/examples) ! +//! For help on how to get started, take a look at the [examples](https://github.com/phil-opp/shared_memory/tree/master/examples) ! use std::fs::{File, OpenOptions}; use std::io::{ErrorKind, Read, Write}; diff --git a/tests/general.rs b/tests/general.rs index f689f54..c18bfbe 100644 --- a/tests/general.rs +++ b/tests/general.rs @@ -1,6 +1,6 @@ use std::path::Path; -use shared_memory::ShmemConf; +use shared_memory_extended::ShmemConf; #[test] fn create_new() { diff --git a/tests/posix_semantics.rs b/tests/posix_semantics.rs index dc10536..330a044 100644 --- a/tests/posix_semantics.rs +++ b/tests/posix_semantics.rs @@ -1,4 +1,4 @@ -use shared_memory::ShmemConf; +use shared_memory_extended::ShmemConf; use std::sync::mpsc::channel; use std::thread; From 5c83400ee4c24b7f04d2afbce453d75854b1de3e Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 21 Jun 2023 10:24:25 +0200 Subject: [PATCH 2/3] Format markdown tables in Readme --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0414286..cc19b0e 100644 --- a/README.md +++ b/README.md @@ -8,18 +8,18 @@ A crate that allows you to share memory between __processes__. Fork of [elast0ny This crate provides lightweight wrappers around shared memory APIs in an OS agnostic way. It is intended to be used with it's sister crate [raw_sync](https://github.com/elast0ny/raw_sync-rs) which provide simple primitves to synchronize access to the shared memory (Mutex, RwLock, Events, etc...). -| raw_sync | -|----| -|[![crates.io](https://img.shields.io/crates/v/raw_sync.svg)](https://crates.io/crates/raw_sync) [![docs.rs](https://docs.rs/raw_sync/badge.svg)](https://docs.rs/raw_sync/)| +| raw_sync | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [![crates.io](https://img.shields.io/crates/v/raw_sync.svg)](https://crates.io/crates/raw_sync) [![docs.rs](https://docs.rs/raw_sync/badge.svg)](https://docs.rs/raw_sync/) | ## Usage For usage examples, see code located in [examples/](examples/) : - | Examples | Description | - |----------|-------------| - |[event](examples/event.rs)| Shows the use of shared events through shared memory| - |[mutex](examples/mutex.rs)| Shows the use of a shared mutex through shared memory| + | Examples | Description | + | -------------------------- | ----------------------------------------------------- | + | [event](examples/event.rs) | Shows the use of shared events through shared memory | + | [mutex](examples/mutex.rs) | Shows the use of a shared mutex through shared memory | ## License From 2e4b5d14b889835ea16a791f960e322b2261051f Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 21 Jun 2023 10:25:12 +0200 Subject: [PATCH 3/3] Update changelog for #1 and #2 --- changelog.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 030f0fe..d5011a6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +# 0.13.0 + +- Create crate as fork of `shared_memory` crate +- Add support for read-only mapping + # 0.12.5 - Update dependencies - Use minimal features for `nix` on unix systems @@ -21,4 +26,4 @@ # __0.11.X__ This release breaks backwards compatibility and removes a bunch of previous features which hid many unsafe behaviors (automatically casting shared memory to Rust types). -The release also marks the split between `shared_memory` and its synchronization primitives into a seperate crate `raw_sync`. \ No newline at end of file +The release also marks the split between `shared_memory` and its synchronization primitives into a seperate crate `raw_sync`.