aboutsummaryrefslogtreecommitdiffstats
path: root/components/allocator/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Migrate to the 2024 edition (#35755)Simon Wülker2025-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | * Migrate to 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow unsafe_op_in_unsafe_fn lint This lint warns by default in the 2024 edition, but is *way* too noisy for servo. We might enable it in the future, but not now. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Compile using the 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* deps: switch to `tikv-jemallocator` crates in Cargo.toml (#32828)Mukilan Thiyagarajan2024-07-221-3/+3
| | | | | | | | | | | | | | | | `jemallocator` and `jemallocator-sys` crates are same as the `tikv-*` versions and these aliases were maintained for historical reasons, based on crates.io documentation. For newer projects, it is recommended to use the `tikv-` versions of the crate. Even though Servo is not a new project, it makes sense to switch to the newer version for the sake of clarity. Also, more importantly, `tikv-jemallocator` has new release (0.6.0) which includes a fix for #32720. There doesn't seem to be a corresponding version publised for the `jemallocator` crate. Fixes #32720 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* deps: Switch from `winapi` to `windows_sys` in Servo code (#32516)Martin Robinson2024-06-171-3/+4
| | | | | This is part of the switch from `winapi` to `windows-sys`. `windows-sys` is maintained by Microsoft, so is more "official." More and more crates are switching to it.
* android: use `jemalloc` on Android (#32273)Mukilan Thiyagarajan2024-05-131-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a fix for the crash issue in 64-bit ARM [#32175][1]. When targeting Android 11 and above, 64-bit ARM platforms have the 'Tagged Pointer' feature enabled by default which causes memory allocated using the system allocator to have a non-zero 'tag' set in the highest byte of heap addresses. This is incompatible with SpiderMonkey which assumes that only the bottom 48 bits are set and asserts this at various points. Both Servo and Gecko have a similar architecture where the pointer to a heap allocated DOM struct is encoded as a JS::Value and stored in the DOM_OBJECT_SLOT (reserved slot) of the JSObject which reflects the native DOM struct. As observed in #32175, even Gecko crashes with `jemalloc` disabled which suggests that support for using the native system allocator with tagged pointers enabled by default is not present at the moment. [1]: https://github.com/servo/servo/issues/32175 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Add font-fallback on OpenHarmony and fix several compilation issues (#32141)Jonathan Schwender2024-05-021-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add OpenHarmony support for allocator / profile Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * gfx: Build harfbuzz from source on OHOS Updates `freetype-sys` to v0.20.1, which includes a build fix for OpenHarmony. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * gfx: Don't depend on fontconfig on OpenHarmony Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * gfx: Add ohos font fallback Hardcode HarmonyOS_Sans_SC_Regular for Chinese Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * libservo: OHOS useragent, and explicitly opt out of sandboxing Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * libservo: Disable get_native_media_display_and_gl_context on ohos Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> --------- Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* rustdoc: Add some basic Safety sections to unsafe functions (#31639)Martin Robinson2024-03-131-0/+12
|
* Use libc::malloc_size on apple (#31602)Samson2024-03-111-4/+4
| | | | | * Use libc::malloc_size on apple * Unify malloc_usable_size under *mut _
* clippy: fix warnings in various modules in components (#31568)eri2024-03-081-3/+1
| | | | | | | | | * clippy: fix warnings in various modules in components * fix: unit tests * fix: build on android * fix: all samplers use new_boxed
* Add `use-system-allocator` to not use jemalloc (#31443)Samson2024-02-291-3/+10
| | | | | * Add `use-system-allocator` feature * Allow `servo_allocator/use-system-allocator` on servoshell
* Preliminary Android build support (#31086)Mukilan Thiyagarajan2024-01-221-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Android build * Fixes * More fixes - Still failing in the linking step * More work on getting linking working Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * android: use mozjs with ndk r25c. loads servo.org more android build fixes. * fix ./mach run for android and make it follow logs Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * add experimental logic for compositor pause/resume Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * pass DPI from android to simpleservo Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * ci: add android workflow Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * switch to ANDROID_SDK_ROOT and ANDROID_NDK_ROOT vars Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * upgrade gradle to 4.10.1 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * upgrade to gradle 5.1.1 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * upgrade to gradle 8 and agp 8 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * make compositing work again with external present Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * android: improve mach support for non-NixOS and CI Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * fix sampler compilation bug introduced in #30490 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * ci: add android build to main workflow Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * gradle: set MinSdk = targetSdk = 30 NDK requires we compile against the minSdk API level which is 30 in our case. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * add instructions for android in README.md Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * apk: move servosurface to servoview Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * apk: uncomment the mediasession callbacks on MainActivity Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * apk: fix crash on MainAtivity.onDestroy Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * apk: drop VR, arm 5 and unused code This commit drops: * support for google, oculusvr * support for arm5 architecture and also removes * fakeld scripts * unused java code Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * cleanup shell.nix Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * android: add FIXMEs for gstreamer code Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * apk: remove commented code and debug logs Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * cleanup ServoView.java Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * mach: comment call to download gstreamer deps for android Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * disable bluetooth for jniapi as blurdroid is broken Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * fixup! README.md * fixup! remove change in Cargo.toml * fixup! move shell variables together * fixup! cleanup jniapi/Cargo.toml comments * delete commented gstreamer related android code Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * remove unused config variable in servbuild Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * android: more cleanup Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * force no_static_freetype only for android * use actions to manage sdk, ndk and java Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * rename embedder event names to be more clear. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * link to startup crash issue Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * fix lint issues Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * upgrade env_logger to 0.10 with duplicate exception libservo and android_logger can use env_logger 0.10 but quickcheck is still stuck on 0.8 and has not seen any activity in the last 2 years. This commit adds a duplicate exception until the quickcheck dependency can be upgraded (or replaced) Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * android: fix comments Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * disable jemalloc on android Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * fixup! replace linux with android in cfg --------- Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Unfork and upgrade jemallocator (#30963)Martin Robinson2024-01-011-75/+6
| | | | | | | | | | This dependency was forked in ##20641 in order to fix the Android build. Years have gone by and it's quite likely that many things have changed in the Android toolchain and these dependencies. We can sort out this issue when getting the Android build working -- or if all else fails, disable jemalloc for Android. In the meantime, unfork the dependency and upgrade it. Fixes #20645.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-3/+5
| | | | | * strict imports formatting * Reformat all imports
* Make Servo components use winapi 0.3Anthony Ramine2019-01-161-1/+1
|
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition-idioms`Simon Sapin2018-11-081-5/+5
|
* Reorder importsPyfisch2018-11-061-2/+2
|
* Format remaining filesPyfisch2018-11-061-24/+16
|
* `cargo fix --edition`Simon Sapin2018-11-061-1/+1
|
* Format component allocator #21373kingdido9992018-08-161-17/+25
|
* Upgrade to rustc 1.28.0-nightly (b68432d56 2018-06-12)Simon Sapin2018-06-141-34/+13
|
* Upgrade to rustc 1.28.0-nightly (524ad9b9e 2018-05-29)Anthony Ramine2018-05-301-6/+1
| | | | Fixes https://github.com/servo/servo/issues/20844
* Revert "Upgrade to rustc 1.27.0-nightly (8a37c75a3 2018-05-02)"Josh Matthews2018-05-181-1/+6
| | | | This reverts commit 46ad8110172cfc9d8d420e8eb41863f3d394e24d.
* Upgrade to rustc 1.27.0-nightly (8a37c75a3 2018-05-02)Simon Sapin2018-05-041-6/+1
|
* Fork the jemallocator crate, fix for nightly-2018-04-15Simon Sapin2018-04-161-7/+77
| | | | | | | | | | | | | CC https://github.com/alexcrichton/jemallocator/pull/40, https://github.com/rust-lang/rust/pull/49669 The new version of jemallocator requires a more recent jemalloc https://github.com/alexcrichton/jemallocator/pull/34 which doesn’t build on our current Android toolchain https://github.com/jemalloc/jemalloc/issues/1175. To avoid blocking on figuring that out, duplicate ~70 lines from jemallocator and use the older jemalloc-sys directly.
* FreeType: don’t use usable_size() as deallocation sizeSimon Sapin2017-10-301-4/+13
| | | | | | | Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it. Hopefully fixes https://github.com/servo/servo/issues/19058
* Stop relying on linking details of std’s default allocatorSimon Sapin2017-10-191-0/+62
We’ve been bitten before by symbol names changing: https://github.com/servo/heapsize/pull/46 and upstream is planning to stop using jemalloc by default: https://github.com/rust-lang/rust/issues/33082#issuecomment-309781465 So use the (relatively) new `#[global_allocator]` attribute to explicitly select the system allocator on Windows and jemalloc (now in an external crate) on other platforms. This choice matches current defaults.