Skip to content

Commit

Permalink
Update instructions to support Apple silicon when segfaulting
Browse files Browse the repository at this point in the history
What?
=====

This updates the README to highlight an approach to addressing unused if
it segfaults by re-installing while skipping mimalloc.
  • Loading branch information
joshuaclayton committed Jun 17, 2021
1 parent 9acfdfc commit f543c1b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,38 @@ brew install unused

This will install `unused` and its corresponding dependencies.

#### Updating

To update, run:

```sh
brew update
brew upgrade unused
```

#### Caveats (Apple M1 Installation)

By default, `unused` leverages a different memory allocator called [mimalloc].
For my local benchmarks, it speeds up execution by a significant amount (which
is documented in the [commit introducing mimalloc]), but currently runs into
sporadic issues on Apple M1 devices.

[mimalloc]: https://github.com/microsoft/mimalloc
[commit introducing mimalloc]: https://github.com/unused-code/unused/commit/a206e557af47109ae7f907b89649da8a39fed932

If you run into [issues with segmentation
faults](https://github.com/unused-code/unused/issues/34), consider reinstalling
unused with the stock Rust allocator.

To refresh your install:

```sh
brew uninstall unused
brew untap unused-code/formulae
brew tap unused-code/formulae
brew install unused --without-mimalloc
```

### Nix

There is a [Nix] expression [available in nixpkgs].
Expand Down

0 comments on commit f543c1b

Please sign in to comment.