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
2 changes: 1 addition & 1 deletion crates/bench/benches/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use spacetimedb_testing::modules::{Csharp, Rust};

#[cfg(target_env = "msvc")]
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[cfg(not(target_env = "msvc"))]
use tikv_jemallocator::Jemalloc;
Expand Down
2 changes: 1 addition & 1 deletion crates/bench/benches/special.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::sync::OnceLock;

#[cfg(target_env = "msvc")]
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[cfg(not(target_env = "msvc"))]
use tikv_jemallocator::Jemalloc;
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/db/relational_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,7 @@ mod tests {
use spacetimedb_sats::buffer::BufReader;
use spacetimedb_sats::product;
use spacetimedb_schema::schema::RowLevelSecuritySchema;
#[cfg(unix)]
use spacetimedb_snapshot::Snapshot;
use spacetimedb_table::read_column::ReadColumn;
use spacetimedb_table::table::RowRef;
Expand Down Expand Up @@ -2909,6 +2910,7 @@ mod tests {
let (dir, repo) = make_snapshot(root.clone(), Identity::ZERO, 0, CompressType::None, true);
stdb.take_snapshot(&repo)?;

#[cfg(unix)]
let total_objects = repo.size_on_disk()?.object_count;
// Another snapshots that will hardlink part of the first one
for i in 0..2 {
Expand Down
9 changes: 5 additions & 4 deletions crates/core/src/worker_metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,15 @@ pub static WORKER_METRICS: Lazy<WorkerMetrics> = Lazy::new(WorkerMetrics::new);
#[cfg(not(target_env = "msvc"))]
use tikv_jemalloc_ctl::{epoch, stats};

#[cfg(not(target_env = "msvc"))]
static SPAWN_JEMALLOC_GUARD: Once = Once::new();
pub fn spawn_jemalloc_stats(node_id: String) {
pub fn spawn_jemalloc_stats(_node_id: String) {
#[cfg(not(target_env = "msvc"))]
SPAWN_JEMALLOC_GUARD.call_once(|| {
spawn(async move {
let allocated_bytes = WORKER_METRICS.jemalloc_allocated_bytes.with_label_values(&node_id);
let resident_bytes = WORKER_METRICS.jemalloc_resident_bytes.with_label_values(&node_id);
let active_bytes = WORKER_METRICS.jemalloc_active_bytes.with_label_values(&node_id);
let allocated_bytes = WORKER_METRICS.jemalloc_allocated_bytes.with_label_values(&_node_id);
let resident_bytes = WORKER_METRICS.jemalloc_resident_bytes.with_label_values(&_node_id);
let active_bytes = WORKER_METRICS.jemalloc_active_bytes.with_label_values(&_node_id);

let e = epoch::mib().unwrap();
loop {
Expand Down
9 changes: 5 additions & 4 deletions crates/paths/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,12 @@ impl SpacetimePaths {

#[cfg(test)]
mod tests {
use std::ffi::{OsStr, OsString};
use crate::{PathBufExt, RootDir, SpacetimePaths};
use std::path::Path;

use super::*;

#[cfg(not(windows))]
mod vars {
use super::*;
use std::ffi::{OsStr, OsString};
struct ResetVar<'a>(&'a str, Option<OsString>);
impl Drop for ResetVar<'_> {
fn drop(&mut self) {
Expand Down Expand Up @@ -320,6 +319,8 @@ mod tests {
#[cfg(windows)]
#[test]
fn windows() {
use crate::SpacetimePaths;

let paths = SpacetimePaths::platform_defaults().unwrap();
let appdata_local = dirs::data_local_dir().unwrap();
assert_eq!(paths.cli_config_dir.0, appdata_local.join("config"));
Expand Down
6 changes: 3 additions & 3 deletions crates/update/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::process::ExitCode;

pub(crate) fn run_cli(
paths: Option<&SpacetimePaths>,
argv0: Option<&OsStr>,
_argv0: Option<&OsStr>,
args: Vec<OsString>,
) -> anyhow::Result<ExitCode> {
let parse_args = || PartialCliArgs::parse(&args);
Expand Down Expand Up @@ -44,8 +44,8 @@ pub(crate) fn run_cli(
#[cfg(unix)]
{
use std::os::unix::process::CommandExt;
if let Some(argv0) = argv0 {
cmd.arg0(argv0);
if let Some(_argv0) = _argv0 {
cmd.arg0(_argv0);
}
};
let exec_result = exec_replace(&mut cmd).with_context(|| format!("exec failed for {}", cli_path.display()));
Expand Down
Loading