Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: update project meta #2

Merged
merged 3 commits into from Jul 21, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -80,10 +80,10 @@ jobs:
# allow(clippy::all) fails in the syscrate, so we can't use --all here:
script: |
if rustup component add clippy-preview ; then
cargo clippy -p jemalloc-sys -- -D clippy::all
cargo clippy -p jemallocator -- -D clippy::all
cargo clippy -p jemallocator-global -- -D clippy::all
cargo clippy -p jemalloc-ctl -- -D clippy::all
cargo clippy -p tikv-jemalloc-sys -- -D clippy::all
cargo clippy -p tikv-jemallocator -- -D clippy::all
cargo clippy -p tikv-jemallocator-global -- -D clippy::all
cargo clippy -p tikv-jemalloc-ctl -- -D clippy::all
fi
- name: "Shellcheck"
install: true
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,6 @@
# 0.4.0 - 2020-07-21

- Forked from jemallocator master
- Upgraded jemalloc to 5.2.1 (#1)
- Fixed wrong version in generated C header (#1)
- Upgraded project to 2018 edition (#2)
43 changes: 22 additions & 21 deletions Cargo.toml
@@ -1,31 +1,32 @@
[package]
name = "jemallocator"
name = "tikv-jemallocator"
# Make sure to update the version in the README as well:
version = "0.3.2"
version = "0.4.0"
authors = [
"Alex Crichton <alex@alexcrichton.com>",
"Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>",
"Simon Sapin <simon.sapin@exyr.org>",
"Steven Fackler <sfackler@gmail.com>"
"Steven Fackler <sfackler@gmail.com>",
"The TiKV Project Developers",
]
license = "MIT/Apache-2.0"
readme = "README.md"
keywords = ["allocator", "jemalloc"]
categories = ["memory-management", "api-bindings"]
repository = "https://github.com/gnzlbg/jemallocator"
homepage = "https://github.com/gnzlbg/jemallocator"
documentation = "https://docs.rs/jemallocator"
repository = "https://github.com/tikv/jemallocator"
homepage = "https://github.com/tikv/jemallocator"
documentation = "https://docs.rs/tikv-jemallocator"
description = """
A Rust allocator backed by jemalloc
"""
edition = "2015"
edition = "2018"

[badges]
appveyor = { repository = "gnzlbg/jemallocator" }
travis-ci = { repository = "gnzlbg/jemallocator" }
codecov = { repository = "gnzlbg/jemallocator" }
is-it-maintained-issue-resolution = { repository = "gnzlbg/jemallocator" }
is-it-maintained-open-issues = { repository = "gnzlbg/jemallocator" }
appveyor = { repository = "tikv/jemallocator" }
travis-ci = { repository = "tikv/jemallocator" }
codecov = { repository = "tikv/jemallocator" }
is-it-maintained-issue-resolution = { repository = "tikv/jemallocator" }
is-it-maintained-open-issues = { repository = "tikv/jemallocator" }
maintenance = { status = "actively-developed" }

[lib]
Expand All @@ -36,23 +37,23 @@ bench = false
members = ["systest", "jemallocator-global", "jemalloc-ctl", "jemalloc-sys" ]

[dependencies]
jemalloc-sys = { path = "jemalloc-sys", version = "0.3.2", default-features = false }
tikv-jemalloc-sys = { path = "jemalloc-sys", version = "0.4.0", default-features = false }
libc = { version = "^0.2.8", default-features = false }

[dev-dependencies]
paste = "0.1"
jemalloc-ctl = { path = "jemalloc-ctl", version = "0.3" }
tikv-jemalloc-ctl = { path = "jemalloc-ctl", version = "0.4" }

[features]
default = ["background_threads_runtime_support"]
alloc_trait = []
profiling = ["jemalloc-sys/profiling"]
debug = ["jemalloc-sys/debug"]
stats = ["jemalloc-sys/stats"]
background_threads_runtime_support = ["jemalloc-sys/background_threads_runtime_support"]
background_threads = ["jemalloc-sys/background_threads"]
unprefixed_malloc_on_supported_platforms = ["jemalloc-sys/unprefixed_malloc_on_supported_platforms"]
disable_initial_exec_tls = ["jemalloc-sys/disable_initial_exec_tls"]
profiling = ["tikv-jemalloc-sys/profiling"]
debug = ["tikv-jemalloc-sys/debug"]
stats = ["tikv-jemalloc-sys/stats"]
background_threads_runtime_support = ["tikv-jemalloc-sys/background_threads_runtime_support"]
background_threads = ["tikv-jemalloc-sys/background_threads"]
unprefixed_malloc_on_supported_platforms = ["tikv-jemalloc-sys/unprefixed_malloc_on_supported_platforms"]
disable_initial_exec_tls = ["tikv-jemalloc-sys/disable_initial_exec_tls"]

[package.metadata.docs.rs]
features = [ "alloc_trait" ]
Expand Down
64 changes: 23 additions & 41 deletions README.md
@@ -1,41 +1,43 @@
# jemallocator
# tikv-jemallocator

[![Travis-CI Status]][travis] [![Appveyor Status]][appveyor] [![Latest Version]][crates.io] [![docs]][docs.rs]

This project is a simplified fork of [jemallocator](https://github.com/gnzlbg/jemallocator) focus on server.

> Links against `jemalloc` and provides a `Jemalloc` unit type that implements
> the allocator APIs and can be set as the `#[global_allocator]`

## Overview

The `jemalloc` support ecosystem consists of the following crates:

* `jemalloc-sys`: builds and links against `jemalloc` exposing raw C bindings to it.
* `jemallocator`: provides the `Jemalloc` type which implements the
* `tikv-jemalloc-sys`: builds and links against `jemalloc` exposing raw C bindings to it.
* `tikv-jemallocator`: provides the `Jemalloc` type which implements the
`GlobalAlloc` and `Alloc` traits.
* `jemalloc-ctl`: high-level wrapper over `jemalloc`'s control and introspection
* `tikv-jemalloc-ctl`: high-level wrapper over `jemalloc`'s control and introspection
APIs (the `mallctl*()` family of functions and the _MALLCTL NAMESPACE_)'

## Documentation

* [Latest release (docs.rs)][docs.rs]
* [Master branch][master_docs]

To use `jemallocator` add it as a dependency:
To use `tikv-jemallocator` add it as a dependency:

```toml
# Cargo.toml
[dependencies]

[target.'cfg(not(target_env = "msvc"))'.dependencies]
jemallocator = "0.3.2"
tikv-jemallocator = "0.4.0"
```

To set `jemallocator::Jemalloc` as the global allocator add this to your project:
To set `tikv_jemallocator::Jemalloc` as the global allocator add this to your project:

```rust
# main.rs
#[cfg(not(target_env = "msvc"))]
use jemallocator::Jemalloc;
use tikv_jemallocator::Jemalloc;

#[cfg(not(target_env = "msvc"))]
#[global_allocator]
Expand All @@ -50,8 +52,8 @@ all allocations requested by Rust code in the same program.
The following table describes the supported platforms:

* `build`: does the library compile for the target?
* `run`: do `jemallocator` and `jemalloc-sys` tests pass on the target?
* `jemalloc`: do `jemalloc`'s tests pass on the target?
* `run`: do `tikv-jemallocator` and `tikv-jemalloc-sys` tests pass on the target?
* `jemalloc`: do `tikv-jemalloc`'s tests pass on the target?
* `valgrind`: do the tests pass under valgrind?

Tier 1 targets are tested on all Rust channels (stable, beta, and nightly). All
Expand All @@ -60,34 +62,15 @@ other targets are only tested on Rust nightly.
| Linux targets: | build | run | jemalloc | valgrind |
|-------------------------------------|-----------|---------|--------------|--------------|
| `aarch64-unknown-linux-gnu` | ✓ | ✓ | ✗ | ✗ |
| `arm-unknown-linux-gnueabi` | ✓ | ✓ | ✗ | ✗ |
| `armv7-unknown-linux-gnueabi` | ✓ | ✓ | ✗ | ✗ |
| `i586-unknown-linux-gnu` | ✓ | ✓ | ✓ | ✗ |
| `i686-unknown-linux-gnu` (tier 1) | ✓ | ✓ | ✓ | ✗ |
| `mips-unknown-linux-gnu` | ✓ | ✓ | ✗ | ✗ |
| `mipsel-unknown-linux-musl` | ✓ | ✓ | ✗ | ✗ |
| `mips64-unknown-linux-gnuabi64` | ✓ | ✓ | ✗ | ✗ |
| `mips64el-unknown-linux-gnuabi64` | ✓ | ✓ | ✗ | ✗ |
| `powerpc-unknown-linux-gnu` | ✓ | ✓ | ✗ | ✗ |
| `powerpc64-unknown-linux-gnu` | ✓ | ✓ | ✗ | ✗ |
| `powerpc64le-unknown-linux-gnu` | ✓ | ✓ | ✗ | ✗ |
| `x86_64-unknown-linux-gnu` (tier 1) | ✓ | ✓ | ✓ | ✓ |
| **MacOSX targets:** | **build** | **run** | **jemalloc** | **valgrind** |
| `x86_64-apple-darwin` (tier 1) | ✓ | ✓ | ✗ | ✗ |
| `i686-apple-darwin` (tier 1) | ✓ | ✓ | ✗ | ✗ |
| **Windows targets:** | **build** | **run** | **jemalloc** | **valgrind** |
| `x86_64-pc-windows-msvc` (tier 1) | ✗ | ✗ | ✗ | ✗ |
| `i686-pc-windows-msvc` (tier 1) | ✗ | ✗ | ✗ | ✗ |
| `x86_64-pc-windows-gnu` (tier 1) | ✓ | ✓ | ✗ | ✗ |
| `i686-pc-windows-gnu` (tier 1) | ✓ | ✓ | ✗ | ✗ |
| **Android targets:** | **build** | **run** | **jemalloc** | **valgrind** |
| `aarch64-linux-android` | ✓ | ✓ | ✗ | ✗ |
| `x86_64-linux-android` | ✓ | ✓ | ✓ | ✗ |

## Features

The `jemallocator` crate re-exports the [features of the `jemalloc-sys`
dependency](https://github.com/gnzlbg/jemallocator/blob/master/jemalloc-sys/README.md).
The `tikv-jemallocator` crate re-exports the [features of the `tikv-jemalloc-sys`
dependency](https://github.com/tikv/jemallocator/blob/master/jemalloc-sys/README.md).

## License

Expand All @@ -103,15 +86,14 @@ at your option.
## Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in `jemallocator` by you, as defined in the Apache-2.0 license,
for inclusion in `tikv-jemallocator` by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.

[travis]: https://travis-ci.com/gnzlbg/jemallocator
[Travis-CI Status]: https://travis-ci.com/gnzlbg/jemallocator.svg?branch=master
[appveyor]: https://ci.appveyor.com/project/gnzlbg/jemallocator/branch/master
[Appveyor Status]: https://ci.appveyor.com/api/projects/status/github/gnzlbg/jemallocator?branch=master&svg=true
[Latest Version]: https://img.shields.io/crates/v/jemallocator.svg
[crates.io]: https://crates.io/crates/jemallocator
[docs]: https://docs.rs/jemallocator/badge.svg
[docs.rs]: https://docs.rs/jemallocator/
[master_docs]: https://gnzlbg.github.io/jemallocator/jemallocator
[travis]: https://travis-ci.com/tikv/jemallocator
[Travis-CI Status]: https://travis-ci.com/tikv/jemallocator.svg?branch=master
[appveyor]: https://ci.appveyor.com/project/tikv/jemallocator/branch/master
[Appveyor Status]: https://ci.appveyor.com/api/projects/status/github/tikv/jemallocator?branch=master&svg=true
[Latest Version]: https://img.shields.io/crates/v/tikv-jemallocator.svg
[crates.io]: https://crates.io/crates/tikv-jemallocator
[docs]: https://docs.rs/tikv-jemallocator/badge.svg
[docs.rs]: https://docs.rs/tikv-jemallocator/
6 changes: 1 addition & 5 deletions benches/roundtrip.rs
Expand Up @@ -3,20 +3,16 @@
#![feature(test, allocator_api)]
#![cfg(feature = "alloc_trait")]

extern crate jemalloc_sys;
extern crate jemallocator;
extern crate libc;
extern crate paste;
extern crate test;

use jemalloc_sys::MALLOCX_ALIGN;
use jemallocator::Jemalloc;
use libc::c_int;
use std::{
alloc::{Alloc, Excess, Layout},
ptr,
};
use test::Bencher;
use tikv_jemalloc_sys::MALLOCX_ALIGN;

#[global_allocator]
static A: Jemalloc = Jemalloc;
Expand Down
4 changes: 2 additions & 2 deletions ci/dox.sh
Expand Up @@ -4,5 +4,5 @@ set -ex

export RUSTDOCFLAGS="--cfg jemallocator_docs"
cargo doc --features alloc_trait
cargo doc -p jemalloc-sys
cargo doc -p jemalloc-ctl
cargo doc -p tikv-jemalloc-sys
cargo doc -p tikv-jemalloc-ctl
28 changes: 15 additions & 13 deletions jemalloc-ctl/Cargo.toml
@@ -1,36 +1,38 @@
[package]
name = "jemalloc-ctl"
version = "0.3.3"
name = "tikv-jemalloc-ctl"
version = "0.4.0"
authors = [
"Steven Fackler <sfackler@gmail.com>",
"Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>"
"Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>",
"The TiKV Project Developers",
]
license = "MIT/Apache-2.0"
readme = "README.md"
categories = ["memory-management", "api-bindings", "development-tools" ]
keywords = ["allocator", "jemalloc"]
repository = "https://github.com/gnzlbg/jemallocator"
homepage = "https://github.com/gnzlbg/jemallocator"
documentation = "https://docs.rs/jemalloc-ctl"
repository = "https://github.com/tikv/jemallocator"
homepage = "https://github.com/tikv/jemallocator"
documentation = "https://docs.rs/tikv-jemalloc-ctl"
description = """
A safe wrapper over jemalloc's control and introspection APIs
"""
edition = "2018"

[badges]
appveyor = { repository = "gnzlbg/jemallocator" }
travis-ci = { repository = "gnzlbg/jemallocator" }
codecov = { repository = "gnzlbg/jemallocator" }
is-it-maintained-issue-resolution = { repository = "gnzlbg/jemallocator" }
is-it-maintained-open-issues = { repository = "gnzlbg/jemallocator" }
appveyor = { repository = "tikv/jemallocator" }
travis-ci = { repository = "tikv/jemallocator" }
codecov = { repository = "tikv/jemallocator" }
is-it-maintained-issue-resolution = { repository = "tikv/jemallocator" }
is-it-maintained-open-issues = { repository = "tikv/jemallocator" }
maintenance = { status = "actively-developed" }

[dependencies]
jemalloc-sys = { path = "../jemalloc-sys", version = "0.3.2" }
tikv-jemalloc-sys = { path = "../jemalloc-sys", version = "0.4.0" }
libc = { version = "0.2", default-features = false }
paste = { version = "0.1" }

[dev-dependencies]
jemallocator = { path = "..", version = "0.3.2" }
tikv-jemallocator = { path = "..", version = "0.4.0" }

[features]
default = []
Expand Down
27 changes: 12 additions & 15 deletions jemalloc-ctl/README.md
Expand Up @@ -11,20 +11,18 @@

## Platform support

Supported on all platforms supported by the [`jemallocator`] crate.
Supported on all platforms supported by the [`tikv-jemallocator`] crate.

## Example

```no_run
extern crate jemallocator;
extern crate jemalloc_ctl;

use std::thread;
use std::time::Duration;
use jemalloc_ctl::{stats, epoch};
use tikv_jemalloc_ctl::{stats, epoch};

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

fn main() {
// Obtain a MIB for the `epoch`, `stats.allocated`, and
Expand Down Expand Up @@ -64,13 +62,12 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in `jemalloc-ctl` by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.

[`jemallocator`]: https://github.com/gnzlbg/jemallocator
[travis]: https://travis-ci.org/gnzlbg/jemallocator
[Travis-CI Status]: https://travis-ci.org/gnzlbg/jemallocator.svg?branch=master
[appveyor]: https://ci.appveyor.com/project/gnzlbg/jemallocator/branch/master
[Appveyor Status]: https://ci.appveyor.com/api/projects/status/github/gnzlbg/jemallocator?branch=master&svg=true
[Latest Version]: https://img.shields.io/crates/v/jemalloc-ctl.svg
[crates.io]: https://crates.io/crates/jemalloc-ctl
[docs]: https://docs.rs/jemalloc-ctl/badge.svg
[docs.rs]: https://docs.rs/jemalloc-ctl/
[master_docs]: https://gnzlbg.github.io/jemallocator/jemalloc-ctl
[`tikv-jemallocator`]: https://github.com/tikv/jemallocator
[travis]: https://travis-ci.com/tikv/jemallocator
[Travis-CI Status]: https://travis-ci.com/tikv/jemallocator.svg?branch=master
[appveyor]: https://ci.appveyor.com/project/tikv/jemallocator/branch/master
[Appveyor Status]: https://ci.appveyor.com/api/projects/status/github/tikv/jemallocator?branch=master&svg=true
[Latest Version]: https://img.shields.io/crates/v/tikv-jemallocator.svg
[crates.io]: https://crates.io/crates/tikv-jemallocator
[docs]: https://docs.rs/tikv-jemallocator/badge.svg
[docs.rs]: https://docs.rs/tikv-jemallocator/
6 changes: 2 additions & 4 deletions jemalloc-ctl/src/arenas.rs
Expand Up @@ -9,14 +9,12 @@ option! {
/// # Examples
///
/// ```
/// # extern crate jemallocator;
/// # extern crate jemalloc_ctl;
/// #
/// # #[global_allocator]
/// # static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// use jemalloc_ctl::arenas;
/// use tikv_jemalloc_ctl::arenas;
/// println!("number of arenas: {}", arenas::narenas::read().unwrap());
///
/// let arenas_mib = arenas::narenas::mib().unwrap();
Expand Down
7 changes: 2 additions & 5 deletions jemalloc-ctl/src/config.rs
Expand Up @@ -12,14 +12,11 @@ option! {
/// # Examples
///
/// ```
/// # extern crate jemallocator;
/// # extern crate jemalloc_ctl;
/// #
/// # #[global_allocator]
/// # static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// use jemalloc_ctl::config;
/// use tikv_jemalloc_ctl::config;
/// let malloc_conf = config::malloc_conf::mib().unwrap();
/// println!("default malloc conf: {}", malloc_conf.read().unwrap());
/// # }
Expand Down