diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d89ff3a..e13f52d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,25 @@ All user visible changes to this project will be documented in this file. This p +## [0.7.0] · 2024-??-?? (unreleased) +[0.7.0]: /../../tree/medea-jason-0.7.0 + +[Diff](https://github.com/instrumentisto/medea-jason/compare/medea-jason-0.6.1...medea-jason-0.7.0) + +### BC Breaks + +- [Cargo features]: + - Replaced `wee_alloc` with `talc`. ([#187]) + +### Changed + +- Replaced [`wee_alloc`] allocator with [`talc`] for web. ([#187]) + +[#187]: /../../pull/187 + + + + ## [0.6.1] · 2024-09-11 [0.6.1]: /../../tree/medea-jason-0.6.1 @@ -397,9 +416,12 @@ All user visible changes to this project will be documented in this file. This p +[Cargo features]: https://doc.rust-lang.org/cargo/reference/features.html [MSRV]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field [SFU]: https://webrtcglossary.com/sfu [Semantic Versioning 2.0.0]: https://semver.org [VP9]: https://bloggeek.me/webrtcglossary/vp9 [`derive_more`]: https://docs.rs/derive_more [`flutter_rust_bridge`]: https://docs.rs/flutter_rust_bridge +[`talc`]: https://docs.rs/talc +[`wee_alloc`]: https://docs.rs/wee_alloc diff --git a/Cargo.lock b/Cargo.lock index b13aba46..4ad29d11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,7 +125,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" dependencies = [ "bytestring", - "cfg-if 1.0.0", + "cfg-if", "http 0.2.12", "regex", "regex-lite", @@ -199,7 +199,7 @@ dependencies = [ "ahash", "bytes", "bytestring", - "cfg-if 1.0.0", + "cfg-if", "cookie 0.16.2", "derive_more 0.99.18", "encoding_rs", @@ -285,7 +285,7 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "getrandom", "once_cell", "version_check", @@ -576,7 +576,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -697,9 +697,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "bytestring" @@ -712,9 +712,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.19" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d74707dde2ba56f86ae90effb3b43ddd369504387e718014de010cec7959800" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", @@ -730,12 +730,6 @@ dependencies = [ "nom", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -851,7 +845,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen", ] @@ -914,7 +908,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1148,7 +1142,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -1205,7 +1199,7 @@ version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1463,7 +1457,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi", @@ -1785,9 +1779,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1878,7 +1872,7 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -2008,7 +2002,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-targets 0.52.6", ] @@ -2079,7 +2073,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "digest", ] @@ -2158,7 +2152,7 @@ dependencies = [ [[package]] name = "medea-jason" -version = "0.6.2-dev" +version = "0.7.0-dev" dependencies = [ "android_logger", "async-recursion", @@ -2185,6 +2179,7 @@ dependencies = [ "serde", "serde_json", "simple_logger", + "talc", "tracerr", "url", "wasm-bindgen", @@ -2192,7 +2187,6 @@ dependencies = [ "wasm-bindgen-test", "wasm-logger", "web-sys", - "wee_alloc", ] [[package]] @@ -2222,12 +2216,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mime" version = "0.3.17" @@ -2284,7 +2272,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c28b3fb6d753d28c20e826cd46ee611fda1cf3cde03a443a974043247c065a" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "downcast", "fragile", "mockall_derive", @@ -2298,7 +2286,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "341014e7f530314e9a1fdbc7400b244efea7122662c96bfa248c31da5bfb2020" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "proc-macro2", "quote", "syn 2.0.77", @@ -2383,9 +2371,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ea5043e58958ee56f3e15a90aee535795cd7dfd319846288d93c5b57d85cbe" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" @@ -2394,7 +2382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -2447,7 +2435,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -2824,7 +2812,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if 1.0.0", + "cfg-if", "getrandom", "libc", "spin", @@ -3116,7 +3104,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] @@ -3384,13 +3372,22 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +[[package]] +name = "talc" +version = "4.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04be12ec299aadd63a0bf781d893e4b6139d33cdca6dcd6f6be31f849cedcac8" +dependencies = [ + "lock_api", +] + [[package]] name = "tempfile" version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "once_cell", "rustix", @@ -3461,7 +3458,7 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -3756,9 +3753,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] @@ -3863,7 +3860,7 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "wasm-bindgen-macro", ] @@ -3889,7 +3886,7 @@ version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -3991,18 +3988,6 @@ dependencies = [ "url", ] -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "which" version = "4.4.2" diff --git a/Cargo.toml b/Cargo.toml index f0f8d824..fff20aed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "medea-jason" -version = "0.6.2-dev" +version = "0.7.0-dev" edition = "2021" rust-version = "1.81" description = "Client library for Medea media server." @@ -31,9 +31,11 @@ crate-type = ["cdylib", "rlib", "staticlib"] lto = "fat" [features] -default = ["console_error_panic_hook", "wee_alloc"] +default = ["console_error_panic_hook", "talc"] +console_error_panic_hook = ["dep:console_error_panic_hook"] dart-codegen = ["medea-macro/dart-codegen"] -mockable = ["mockall"] +mockable = ["dep:mockall"] +talc = ["dep:talc"] [dependencies] async-recursion = "1.1" @@ -71,10 +73,10 @@ send_wrapper = "0.6" backoff = { version = "0.4", features = ["wasm-bindgen"] } console_error_panic_hook = { version = "0.1", optional = true } js-sys = "0.3" +talc = { version = "4.4", features = ["lock_api"], default-features = false, optional = true } wasm-bindgen = "0.2.93" wasm-bindgen-futures = "0.4.43" wasm-logger = "0.2" -wee_alloc = { version = "0.4", optional = true } [target.'cfg(target_family = "wasm")'.dependencies.web-sys] version = "0.3.70" features = [ diff --git a/flutter/android/build.gradle b/flutter/android/build.gradle index 762027ad..e26690be 100644 --- a/flutter/android/build.gradle +++ b/flutter/android/build.gradle @@ -1,5 +1,5 @@ group 'com.medea.jason' -version '0.6.2-dev' +version '0.7.0-dev' buildscript { repositories { diff --git a/flutter/example/pubspec.lock b/flutter/example/pubspec.lock index 787a8421..e474fd11 100644 --- a/flutter/example/pubspec.lock +++ b/flutter/example/pubspec.lock @@ -336,7 +336,7 @@ packages: path: ".." relative: true source: path - version: "0.6.2-dev" + version: "0.7.0-dev" meta: dependency: transitive description: diff --git a/flutter/ios/medea_jason.podspec b/flutter/ios/medea_jason.podspec index ed6378c6..8bee5e54 100644 --- a/flutter/ios/medea_jason.podspec +++ b/flutter/ios/medea_jason.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'medea_jason' - s.version = '0.6.2-dev' + s.version = '0.7.0-dev' s.summary = 'Cross-platform client library of Medea media server for Flutter.' s.description = 'Cross-platform client library of Medea media server for Flutter.' s.homepage = 'https://github.com/instrumentisto/medea-jason' diff --git a/flutter/macos/medea_jason.podspec b/flutter/macos/medea_jason.podspec index e8247631..7a0192dc 100644 --- a/flutter/macos/medea_jason.podspec +++ b/flutter/macos/medea_jason.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'medea_jason' - s.version = '0.6.2-dev' + s.version = '0.7.0-dev' s.summary = 'Cross-platform client library of Medea media server for Flutter.' s.description = 'Cross-platform client library of Medea media server for Flutter.' s.homepage = 'https://github.com/instrumentisto/medea-jason' diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index 8a96a79c..202cf697 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: medea_jason description: Cross-platform client library of Medea media server for Flutter. -version: 0.6.2-dev +version: 0.7.0-dev homepage: https://github.com/instrumentisto/medea-jason/blob/master/flutter environment: diff --git a/src/platform/wasm/mod.rs b/src/platform/wasm/mod.rs index 88588f03..6934a7fa 100644 --- a/src/platform/wasm/mod.rs +++ b/src/platform/wasm/mod.rs @@ -38,11 +38,14 @@ pub use self::{ /// Unimplemented on WASM targets. pub type MediaDisplayInfo = (); -#[cfg(feature = "wee_alloc")] -/// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global -/// allocator. +#[cfg(feature = "talc")] +/// [`talc`] as the global allocator. +/// +/// # Safety +/// +/// The runtime environment must be single-threaded WASM. #[global_allocator] -static ALLOC: wee_alloc::WeeAlloc<'_> = wee_alloc::WeeAlloc::INIT; +static ALLOCATOR: talc::TalckWasm = unsafe { talc::TalckWasm::new_global() }; /// When the `console_error_panic_hook` feature is enabled, we can call the /// `set_panic_hook` function at least once during initialization, and then