Skip to content

Requesting Documentation for Using Subprocess #1316

Description

@kalaxy

I'm exploring the v3.3.2 (in a Linux env) subproccess api and am not getting very far. I have a test program:

#include <mimalloc.h>
#include <thread>

int main() {
    auto my_subproc = mi_subproc_new();
    std::thread t([&]() {
        mi_subproc_add_current_thread(my_subproc);
        mi_free(mi_malloc(1024));
    });
    t.join();
    mi_subproc_destroy(my_subproc);
    return 0;
}

It fails with the assertion:

mimalloc: assertion failed: at "/home/kmills/.conan2/p/b/mimal197d35e7834f1/b/src/src/init.c":446, _mi_subproc_heap_main
  assertion: "mi_atomic_load_relaxed(&subproc->heap_main) != NULL"

Is there more to initializing a subprocess than calling mi_subproc_new()?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions