dlmalloc-rs icon indicating copy to clipboard operation
dlmalloc-rs copied to clipboard

Add `nightly` feature flag for `Alloc` -> `AllocRef` changes

Open KronicDeth opened this issue 5 years ago • 6 comments

Technically there was another breaking change in AllocRef later, so idk if calling the feature nightly is best or if using rustc-version cfg would be better, but if anyone else finds this useful, this works for our rustup default nightly-2020-03-10 based-builds.

Changelog

Enhancement

  • Add nightly feature for nightly-2020-03-10 compatibility. Changes uses of Alloc to AllocRef with accompanying function signatures.

KronicDeth avatar Mar 13 '20 04:03 KronicDeth

I unfortunately don't have a ton of time to follow the changes upstream, so given the instability of the API my preference would likely be to remove the nightly support rather than trying to keep up with it I think?

alexcrichton avatar Mar 13 '20 16:03 alexcrichton

We’re using nightly for WASM support and we’re also using dlmallloc for WASM support. Would that mean we would lose WASM support?

KronicDeth avatar Mar 13 '20 16:03 KronicDeth

Do you mean the Rust standard library or something external? This feature doesn't affect Rust's usage of dlmalloc for the wasm target, nor external wasm users using the dlmalloc crate for a global allocator. This is specifically for a nightly feature which you have to opt-in to with unstable APIs, which rarely happens I believe right now.

alexcrichton avatar Mar 13 '20 19:03 alexcrichton

Hmm... Ok, my development notes are probably just wrong then.

We are likely using the allocator-api because dlmalloc is supplying the low-level "sys_alloc" that we build the GC allocator on top of in Lumen (Erlang in the browser and other AOT targets)

KronicDeth avatar Mar 13 '20 19:03 KronicDeth

As I am the only contributer from the allocator wg, I could update this crate as well if this is really needed. There is a major overhaul of AllocRef in the queue, so before putting to much effort into this, the linked PR should have landed.

TimDiekmann avatar Mar 16 '20 16:03 TimDiekmann

There isn't a great need for this for Rust's libstd, but I"m not familiar with @KronicDeth's Lumen use case, which may need it.

alexcrichton avatar Mar 17 '20 14:03 alexcrichton