[petsc-dev] clang --analyze messages on PETSc

Lisandro Dalcin dalcinl at gmail.com
Thu Apr 16 01:53:51 CDT 2015


On 15 April 2015 at 21:10, Jed Brown <jed at jedbrown.org> wrote:
> Barry Smith <bsmith at mcs.anl.gov> writes:
>>    How to handle MallocK() where say the second item has length zero?
>
> You mean in optimized mode?  (Debug mode can and should call malloc(0)
> every time.)  I think either NULL or the same address is fine.  We don't
> have sentinels in optimized mode anyway.
>

What about making coalesced mallocs a runtime option?

That way we could run optimized builds like this:

$ valgrind ./program -malloc_coalesced 0

to detect invalid memory accesses.

Do you expect any noticeable performance penalty?

-- 
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459



More information about the petsc-dev mailing list