[Assorted-commits] SF.net SVN: assorted: [619] numa-bench/trunk/src/chew.cc
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-03-10 23:54:19
|
Revision: 619 http://assorted.svn.sourceforge.net/assorted/?rev=619&view=rev Author: yangzhang Date: 2008-03-10 16:54:07 -0700 (Mon, 10 Mar 2008) Log Message: ----------- added conditional numa compilation Modified Paths: -------------- numa-bench/trunk/src/chew.cc Modified: numa-bench/trunk/src/chew.cc =================================================================== --- numa-bench/trunk/src/chew.cc 2008-03-10 19:52:06 UTC (rev 618) +++ numa-bench/trunk/src/chew.cc 2008-03-10 23:54:07 UTC (rev 619) @@ -3,7 +3,9 @@ #include <sched.h> +#ifdef HAVE_NUMA #include <numa.h> +#endif #include <boost/bind.hpp> @@ -100,13 +102,21 @@ void * alloc(size_t sz) { +#ifdef HAVE_NUMA return use_numa ? numa_alloc_local(sz) : malloc(sz); +#else + return malloc(sz); +#endif } void dealloc(void *p, size_t sz) { +#ifdef HAVE_NUMA return use_numa ? numa_free(p, sz) : free(p); +#else + return free(p); +#endif } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |