Skip to content

tcmalloc rust bindings #276

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 6 commits into
base: master
Choose a base branch
from
Open

Conversation

jayakasadev
Copy link
Contributor

@jayakasadev jayakasadev commented Mar 26, 2025

Added tcmalloc_rs which generates necessary rust bindings and surfaces a lib for rust users to adopt tcmalloc.

tcmalloc/BUILD Outdated
load("//tcmalloc:copts.bzl", "TCMALLOC_DEFAULT_COPTS")
load("//tcmalloc:variants.bzl", "create_tcmalloc_benchmark", "create_tcmalloc_libraries", "create_tcmalloc_testsuite")

package(default_visibility = ["//visibility:private"])

licenses(["notice"])

exports_files(["LICENSE"])
exports_files(["LICENSE", "tcmalloc.h"])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

export of tcmalloc.h required to generate rust bindings.

Comment on lines +31 to +42
bool_flag(
name = "alwayslink",
build_setting_default = True,
)

config_setting(
name = "unlinked",
flag_values = {
":alwayslink": "false",
},
visibility = ["//visibility:public"],
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

alwayslink generates a .lo file which is not recognized by rustc. This flags allws users to disable it for rust specifically.

@jayakasadev jayakasadev force-pushed the rust_client branch 2 times, most recently from 61ccfdb to ed11cc4 Compare March 26, 2025 20:20
@jayakasadev jayakasadev marked this pull request as draft March 26, 2025 20:21
@jayakasadev jayakasadev force-pushed the rust_client branch 6 times, most recently from a78505e to f9e8f49 Compare March 27, 2025 01:34
@jayakasadev jayakasadev marked this pull request as ready for review March 27, 2025 13:37
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.

1 participant