On Wed, May 09, 2012 at 05:48:25PM +0800, Dehao Chen wrote: > > So why not use an alternate interface into this special allocator for this > > purpose? > > There can be the following scenario: > > We want to add a module to an existing app. Before implementing the > module, we want to collect some statistics on real runs. In this > scenario, we need: > > * No change to the legacy code > * Optimized build for the simulation run > * Provide accurate statistical info > > We want to collect data for both new module and the legacy code > without changing the later, thus we cannot use a new malloc/free > interface.
Note that even in the glibc testsuite there had to be workarounds for this (asm barrier was used): http://sources.redhat.com/ml/libc-alpha/2012-05/msg00138.html Jakub