scons: Avoid malloc/free compiler optimization when using tcmalloc
authorAndreas Sandberg <andreas@sandberg.pp.se>
Mon, 18 Mar 2013 09:57:26 +0000 (10:57 +0100)
committerAndreas Sandberg <andreas@sandberg.pp.se>
Mon, 18 Mar 2013 09:57:26 +0000 (10:57 +0100)
commit468ad10f502837ed00f9e91ed16b9eb180adff4c
treee271ae815e4734c67848a586e2d362045cb10353
parent9e9a47cb9ae69b081206372179b069e6150e7891
scons: Avoid malloc/free compiler optimization when using tcmalloc

According to the tcmalloc readme, the recommended way of compiling
applications that make use of tcmalloc is to disable compiler
optimizations that make assumptions about malloc and friends. This
changeset adds the necessary compiler flags for both gcc and clang.

From the tcmalloc readme:
"NOTE: When compiling with programs with gcc, that you plan to link
with libtcmalloc, it's safest to pass in the flags

 -fno-builtin-malloc -fno-builtin-calloc
 -fno-builtin-realloc -fno-builtin-free

when compiling."
SConstruct