Skip to content

Commit

Permalink
aw-server: Disable jemalloc on non-x86 CPUs
Browse files Browse the repository at this point in the history
jemalloc is only properly tested on x86 on Linux and doesn't even
compile for aarch64 it seems.
Needed for aw-server to compile for Linux phones such as PinePhone and
Librem 5.
  • Loading branch information
johan-bjareholt committed Feb 7, 2021
1 parent 3b9f31d commit 828db39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion aw-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ aw-query = { path = "../aw-query" }
[target.'cfg(target_os="linux")'.dependencies]
jemallocator = "0.3.2"

[target.'cfg(target_os="android")'.dependencies]
[target.'cfg(all(target_os="android", target_arch="x86"))'.dependencies]

This comment has been minimized.

Copy link
@ErikBjare

ErikBjare Feb 21, 2021

Member

This breaks builds for all non-x86 devices.

This comment has been minimized.

Copy link
@johan-bjareholt

johan-bjareholt Feb 21, 2021

Author Member

Sloppy of me, mixed up jni with jemalloc

jni = { version = "0.18", default-features = false }
libc = "0.2"
android_logger = "0.9"
Expand Down
4 changes: 2 additions & 2 deletions aw-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use std::env;

use aw_server::*;

#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", target_arch = "x86"))]
extern crate jemallocator;
#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", target_arch = "x86"))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

Expand Down

0 comments on commit 828db39

Please sign in to comment.