Skip to content

how to use mimalloc in bazel project #639

@viktorika

Description

@viktorika

i use bazel's malloc option to link mimalloc,and the compilation of mimaloc is as follows

cc_library(
name = "mimalloc",
srcs = [
"src/static.c",
],
textual_hdrs = glob(["src/.c", "src/.h"], exclude = ["src/static.c"]),
hdrs = glob(["include/*.h"]),
includes = ["include"],
copts = [
"-DMI_MALLOC_OVERRIDE",
"-O2",
"-Wall",
"-Wextra",
"--std=c++17",
],
linkopts = [
"-pthread",
"-lrt",
],
visibility = ["//visibility:public"],
)

because of the global variable initialization order,i find i can't control mi_process_load function execute before mi_malloc,What should I do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions