From: Steve Reinhardt Date: Tue, 16 Dec 2003 04:55:10 +0000 (-0800) Subject: Add #define parameter and corresponding build option to X-Git-Tag: m5_1.0_beta2~231^2~3 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e537fb3fd61f62040a579976c27903bcb2d52939;p=gem5.git Add #define parameter and corresponding build option to disable FastAlloc. Gcc 3.3.x appears to have a bug that breaks FastAlloc when compiled with optimization. base/fast_alloc.cc: base/fast_alloc.hh: #define NO_FAST_ALLOC makes FastAlloc a no-op. --HG-- extra : convert_revision : bf4bb8e963331c6782f2cfd475a811aa520e31b5 --- diff --git a/base/fast_alloc.cc b/base/fast_alloc.cc index ff0a40c37..abb50aa0c 100644 --- a/base/fast_alloc.cc +++ b/base/fast_alloc.cc @@ -32,6 +32,8 @@ * by permission. */ +#ifndef NO_FAST_ALLOC + #ifdef __GNUC__ #pragma implementation #endif @@ -189,3 +191,5 @@ fast_alloc_oldest(int n) } #endif + +#endif // NO_FAST_ALLOC diff --git a/base/fast_alloc.hh b/base/fast_alloc.hh index 7d699abd1..81f2f1359 100644 --- a/base/fast_alloc.hh +++ b/base/fast_alloc.hh @@ -68,6 +68,13 @@ // (by bucket). // #define FAST_ALLOC_STATS +#ifdef NO_FAST_ALLOC + +class FastAlloc { +}; + +#else + class FastAlloc { public: @@ -200,4 +207,6 @@ void FastAlloc::operator delete(void *p, size_t sz) deallocate(p, sz); } +#endif // NO_FAST_ALLOC + #endif // __FAST_ALLOC_H__