Skip to content

How to forget memory with the jemalloc strategy. #121

@fishiu

Description

@fishiu

Hello, I was using PyO3 to bind this rust code to python and is now struggling with the memory ownership problem (more specifically, double free).

When I try to pass an lmr to python, I do std::mem::forget(lmr) to make rust forget about the memory, as the memory is already somehow transfered to python by some unsafe pointer operations.

However, according to my reasoning, I think the jemalloc strategy does not give up this memory even lmr.drop() is not called. Is this expected? Is there way to forget this memory in jemalloc strategy?

P.S. raw strategy works fine and no double free occurs.

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