Skip to content

Conversation

jacob-hughes
Copy link
Collaborator

Previously users had to ensure they set the #[global_allocator] in order to use Alloy. This was never ideal, but it was necessary because it was too difficult to implement when we statically linked libgc. We've changed this to use dynamic linkage now, and I also know my way around the bootstrap process, so I've fixed this long standing annoyance.

In addition, this is also needed for more precise metric tracking in our benchmarks, where we use different allocators depending whether we're constructing an Rc / Arc etc. Now, these will always correctly resolve to the libgc allocator.

@jacob-hughes jacob-hughes force-pushed the default-global-allocator branch from 9c1469a to f62d899 Compare June 20, 2025 10:16
@ltratt ltratt added this pull request to the merge queue Jun 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 20, 2025
@jacob-hughes
Copy link
Collaborator Author

This PR is now ready for review again. There were a couple of things I needed to add and it made sense to split it up into separate commits:

If you're happy, I can squash.

@ltratt
Copy link
Member

ltratt commented Jun 24, 2025

Please squash.

Previously users had to ensure they set the #[global_allocator] in order
to use Alloy. This was never ideal, but it was necessary because it was
too difficult to implement when we statically linked libgc. We've
changed this to use dynamic linkage now, and I also know my way around
the bootstrap process, so I've fixed this long standing annoyance.

In addition, this is also needed for more precise metric tracking in our
benchmarks, where we use different allocators depending whether we're
constructing an `Rc` / `Arc` etc. Now, these will always correctly
resolve to the libgc allocator.
For platform compatibilty with Windows, Rust disables support for
distributing custom toolchains which contain symlinks. However, our
custom `libgc`, which is installed in sysroot, might include symlinks to
the versioned `libgc.so` SONAME on some platforms. We should allow this
because we don't support Windows anyway.
@jacob-hughes jacob-hughes force-pushed the default-global-allocator branch from e2bd99e to 9738e1c Compare June 24, 2025 09:19
@jacob-hughes
Copy link
Collaborator Author

Squashed

@ltratt ltratt added this pull request to the merge queue Jun 24, 2025
Merged via the queue into softdevteam:master with commit e7c606e Jun 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants