Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "1"
members = [
"core",
"log",
Expand All @@ -8,14 +9,8 @@ members = [
[patch.crates-io]
flashfunk-core = { path = "./core" }
owned-log = { path = "./log" }

xitca-client = { git = "https://github.com/HFQR/xitca-web.git" }
xitca-http = { git = "https://github.com/HFQR/xitca-web.git" }
xitca-io = { git = "https://github.com/HFQR/xitca-web.git" }
xitca-service = { git = "https://github.com/HFQR/xitca-web.git" }
xitca-unsafe-collection = { git = "https://github.com/HFQR/xitca-web.git" }

http-ws = { git = "https://github.com/HFQR/xitca-web.git" }
xitca-client = { git = "https://github.com/HFQR/xitca-web/" }
http-ws = { git = "https://github.com/HFQR/xitca-web/" }

[profile.release]
lto = true
Expand Down
5 changes: 1 addition & 4 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ std = ["core_affinity"]
async = ["std", "futures-core", "parking"]

[dependencies]
cache-padded = "1.1.1"

# core affinity support
crossbeam-utils = "0.8"
core_affinity = { version = "0.8", optional = true }

# async feature support
futures-core = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
parking = { version = "2", optional = true }
Expand Down
10 changes: 5 additions & 5 deletions core/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ pub mod fx_hasher;
pub mod no_hasher;
pub mod spin;

pub(super) mod pin_to_core {
pub mod pin_to_core {
use alloc::vec::Vec;

#[cfg(feature = "std")]
pub(crate) type CoreId = core_affinity::CoreId;
pub type CoreId = core_affinity::CoreId;

#[cfg(not(feature = "std"))]
pub(crate) struct CoreId;
pub struct CoreId;

pub(crate) fn get_core_ids() -> Vec<CoreId> {
pub fn get_core_ids() -> Vec<CoreId> {
#[cfg(feature = "std")]
{
core_affinity::get_core_ids().unwrap()
Expand All @@ -29,7 +29,7 @@ pub(super) mod pin_to_core {
}
}

pub(crate) fn pin_to_core(id: Option<CoreId>) {
pub fn pin_to_core(id: Option<CoreId>) {
if let Some(id) = id {
#[cfg(feature = "std")]
{
Expand Down
2 changes: 1 addition & 1 deletion core/src/util/spsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use core::{

use alloc::{sync::Arc, vec::Vec};

use cache_padded::CachePadded;
use crossbeam_utils::CachePadded;

/// The inner representation of a single-producer single-consumer queue.
struct Inner<T> {
Expand Down
4 changes: 2 additions & 2 deletions examples/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}

for _ in 0..99 {
owned_log::log!(Box::new(MyValue(1)));
owned_log::log!(MyValue(1));
}

let flag = Arc::new(AtomicBool::new(false));
Expand All @@ -47,7 +47,7 @@

while time < 8 {
if flag.swap(false, Ordering::SeqCst) {
let value = Box::new(MyValue(2)) as _;
let value = MyValue(2);
let now = std::time::Instant::now();
owned_log::log!(value);
total += now.elapsed().as_nanos();
Expand All @@ -71,7 +71,7 @@
impl MyLogger {
pub fn with_handler<F>(mut func: F, id: Option<usize>)
where
F: FnMut(Box<dyn Value>) -> () + Send + 'static,

Check warning on line 74 in examples/src/log.rs

View workflow job for this annotation

GitHub Actions / clippy

unneeded unit return type

warning: unneeded unit return type --> examples/src/log.rs:74:33 | 74 | F: FnMut(Box<dyn Value>) -> () + Send + 'static, | ^^^^^^ help: remove the `-> ()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit = note: `#[warn(clippy::unused_unit)]` on by default
{
let queue = Arc::new(ArrayQueue::new(256));

Expand Down
2 changes: 1 addition & 1 deletion log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub static OWNED_LOGGER: OnceCell<Arc<dyn OwnedLog>> = OnceCell::new();
#[macro_export]
macro_rules! log {
($value: expr) => {
::owned_log::__private::OWNED_LOGGER_LOCAL.with(|logger| logger.log($value));
::owned_log::__private::OWNED_LOGGER_LOCAL.with(|logger| logger.log(Box::new($value)));
};
}

Expand Down
Loading