Skip to content
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

Sometimes I got memory errors #349

Open
linwaytin opened this issue Feb 15, 2023 · 0 comments
Open

Sometimes I got memory errors #349

linwaytin opened this issue Feb 15, 2023 · 0 comments

Comments

@linwaytin
Copy link

I have a c++ function which takes a std::vector<double> as the input, and returns a double. I wrap it as follows

JLCXX_MODULE define_julia_module(jlcxx::Module& mod)
{
  mod.method("GF6", &GF6);
}

In julia, I have

module CppGF
PATH_TO_CPPLIB = "path_to_cpplib"
using CxxWrap
@wrapmodule(PATH_TO_CPPLIB)

function __init__()
    @initcxx
end
end

This does work most time, but sometimes I got memory-related errors, like free(): invalid pointer from the line

@wrapmodule(PATH_TO_CPPLIB)

Does anyone have ideas about this issue?

@linwaytin linwaytin changed the title Sometime I got memory errors Sometimes I got memory errors Feb 15, 2023
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

No branches or pull requests

1 participant