microsoft / microsoft/mimalloc

`libatomic` is mandatory even when platform does not need it

Open
#634 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

Few older platforms require `libatomic` for atomic operations but many of them don't (ARMv7 and higher, i686 and higher). `mimalloc` however uses it irrespective of target platform when `libatomic` is installed making it also part of public interface meaning libraries depending on `mimalloc` also need `libatomic`:
https://github.com/microsoft/mimalloc/blob/f2712f4a8f038a7fb4df2790f4c3b7e3ed9e219b/CMakeLists.txt#L229-L232

Would be good if:
- `mimalloc` checked if `libatomic` is really required for target platform (by trying to compile representative atomic operation used within project)
- even if required I don't see a reason for `libatomic` being part of public interface so probably better to make it private

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at CMakeLists.txt lines 229-232 and inspect how libatomic is detected and exposed to dependents. Check representative atomic operations on the target platforms, then verify that libatomic is linked only when required and is not part of mimalloc's public interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.