Hello,
I am wondering is it obligatory to use BFT_MALLOC/BFT_FREE in the user functions (boundary conditions and initilization)? Or it is possible to use usual malloc/free?
I am wondering about that because I am using regular malloc/free and looks like I have some memory leaks, but not sure where it comes from.
Best regards,
Konstantin
Regular malloc/free in CS
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 4077
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Regular malloc/free in CS
Hello,
You can use malloc/free as long as you do not mix with BFT_MALLOC/BFT_FREE.
BFT_MALLOC and BFT_FREE add instrumentation : if you define a file name in the CS_MEM_LOG environment variable (which you must then export in your environment), you will have a trace and leak report... The simplest way to do this is to add:
Best regards,
Yvan
You can use malloc/free as long as you do not mix with BFT_MALLOC/BFT_FREE.
BFT_MALLOC and BFT_FREE add instrumentation : if you define a file name in the CS_MEM_LOG environment variable (which you must then export in your environment), you will have a trace and leak report... The simplest way to do this is to add:
in the runcase file, before the "code_saturne run" line.export CS_MEM_LOG=mem_log
Best regards,
Yvan
Re: Regular malloc/free in CS
Thanks a lot for your reply, Yvan.
At the end valgrind and your advice help me to find the memory leaks in my code.
Best regards,
Konstantin
At the end valgrind and your advice help me to find the memory leaks in my code.
Best regards,
Konstantin