Skip to content
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

Document JEMALLOC_OVERRIDE #107

Merged
merged 1 commit into from
Nov 11, 2024
Merged

Conversation

nmattia
Copy link

@nmattia nmattia commented Nov 5, 2024

This adds a README paragraph explaining how to provider a prebuilt version of malloc through JEMALLOC_OVERRIDE, as well as build flags expected by tikv-jemalloc-sys.

Copy link

ti-chi-bot bot commented Nov 5, 2024

Welcome @nmattia! It looks like this is your first PR to tikv/jemallocator 🎉

@nmattia
Copy link
Author

nmattia commented Nov 5, 2024

I'm unfortunately getting a 404 here: https://github.com/tikv/jemallocator/blob/master/CONTRIBUTING.md

provide your own `jemalloc` version, set `JEMALLOC_OVERRIDE` to point to a built
version of `jemalloc`. This can point to either a shared or static library. For
instance: `JEMALLOC_OVERRIDE=/path/to/libjemalloc.a`. The library should be built
with `jemalloc`'s `--with-jemalloc-prefix=_rjem_`. For static libraries it is also
Copy link
Member

Choose a reason for hiding this comment

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

It's not accurate. Whether prefix is required depends on whether unprefixed_malloc_on_supported_platforms is enabled and whether the target is compatible with overwriting malloc.

Copy link
Author

Choose a reason for hiding this comment

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

It's not accurate.

Right, though the default seems to be to use the prefixed version so I thought this was simpler. Should I mention the prefix logic here? I'd need to dig into it a bit more.

Copy link
Member

Choose a reason for hiding this comment

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

How about changing it like following?

JEMALLOC_OVERRIDE is for advanced usage only. Providing your own library means most features of jemalloc-sys will be ignored in build script, and you are responsible to compile the library to match what jemalloc-sys expects. Especially, handle API prefix as whatever feature unprefixed_malloc_on_supported_platforms says.

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good. PTAL @BusyJay !

@BusyJay
Copy link
Member

BusyJay commented Nov 9, 2024

@nmattia
Copy link
Author

nmattia commented Nov 9, 2024

@BusyJay unfortunately I’m getting a 404. How do I sign it?

@BusyJay
Copy link
Member

BusyJay commented Nov 10, 2024

The link I provided is different from the bot one.

This adds a README paragraph explaining how to provider a prebuilt
version of malloc through `JEMALLOC_OVERRIDE`, as well as build flags
expected by `tikv-jemalloc-sys`.

Signed-off-by: Nicolas Mattia <nicolas@nmattia.com>
@nmattia
Copy link
Author

nmattia commented Nov 11, 2024

@BusyJay got it:) thanks!

@BusyJay BusyJay merged commit 876bc11 into tikv:main Nov 11, 2024
10 checks passed
@BusyJay
Copy link
Member

BusyJay commented Nov 11, 2024

Thank you!

@nmattia nmattia deleted the nm-jemalloc-override branch November 11, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants