Skip to content

Add mallopt and related constants for Android #4459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chriswailes
Copy link

@chriswailes chriswailes commented May 23, 2025

Description

This change adds constants that can be passed to BIONIC's implementation of mallopt

Sources

Constant definitions in BIONIC source: https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/include/malloc.h;l=215

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented May 23, 2025

Some changes occurred in the Android module

cc @maurer

@chriswailes chriswailes changed the title Add mallopt related constants for Android Add mallopt and related constants for Android May 23, 2025
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@rustbot label +stable-nominated

@rustbot rustbot added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label May 28, 2025
The `HeapTaggingLevel` enum does not have a typedef alias and thus
generated tests will not compile due to the missing `enum` keyword.  As
a result the constants are defined using `i32` to match the signature
for `mallopt`.

See: https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/include/malloc.h;l=215
@tgross35 tgross35 enabled auto-merge May 28, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants