Skip to content

Conversation

ferranbt
Copy link
Contributor

@ferranbt ferranbt commented Jun 9, 2025

📝 Summary

Before, in the src folder we had both a main.rs function and an import lib.rs one. This setup created problems because methods exported in lib were not available for main since I believe the execution contexts were different.

This PR changes that and splits the op-rbuilder in two components, a library (under src) and the op-rbuilder main binary (under bin) which consumes the library. Other than the main split in functionality this PR does not introduce any other ergonomics about how to structure better the library to be consumed by the main binary. I will leave that to followup PRs that consume this functionality.

// Prefer jemalloc for performance reasons.
#[cfg(all(feature = "jemalloc", unix))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should move this to main, because lib shouldn't set global allocator

@ferranbt ferranbt mentioned this pull request Jun 9, 2025
@ferranbt ferranbt merged commit 8c5737a into main Jun 9, 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