Closed CPFelix closed 2 years ago
Seems like a problem in the go code calling spdlog. Probably not in spdlog scope.
But if app don't call the .so, Native Heap won't increase.
And when I used dsmLog.debug(" InstanceRun..." + std::to_string(1000.111222))
instead of dsmLog.debug(" InstanceRun...{}", 1000.111222)
,Native Heap won't increase too.
I am not using the Go language, but it should not be possible to call C++ directly.
At the very least, it must go through a C function that wraps a C++ function (extern "C"
), as described on Stack Overflow.
First make sure that there are no problems with the C functions provided by your so
file.
I am not using the Go language, but it should not be possible to call C++ directly.
I couldn't find the point in the Go documentation, but there was a comment in the Issue:
https://github.com/golang/go/issues/40594#issuecomment-669489420
CGO only allows calling/using C code within Go, not C++. To use C++ code you need to create a C wraper, you can do that by adding a
.cpp
and a.h
file with the C API into the package.
I am not using the Go language, but it should not be possible to call C++ directly.
I couldn't find the point in the Go documentation, but there was a comment in the Issue:
CGO only allows calling/using C code within Go, not C++. To use C++ code you need to create a C wraper, you can do that by adding a
.cpp
and a.h
file with the C API into the package.
Yes, I has created a C wraper above, I didn't describe it very well before.
Since it is unlikely that Go experts will visit this project, I recommend that you contact the Go community to see if there are any problems with the code in the so
file.
OK,I will continue check it.
I used the header only (V1.10.0) in C++, and compiler .so file for the upper application writed by GO. And when I test the application, find Native Heap will increase continuously(use
dumpsys meminfo <app_name>
in RK3568). And when I useddsmLog.debug(" InstanceRun..." + std::to_string(1000.111222))