[complement-svn] SF.net SVN: complement:[1957] trunk/complement/explore/perf/alloc
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2008-08-12 14:32:08
|
Revision: 1957 http://complement.svn.sourceforge.net/complement/?rev=1957&view=rev Author: complement Date: 2008-08-12 14:32:04 +0000 (Tue, 12 Aug 2008) Log Message: ----------- add tests: big alloc and mix of big and small alloc Modified Paths: -------------- trunk/complement/explore/perf/alloc/alloc_perf_suite.cc trunk/complement/explore/perf/alloc/alloc_perf_suite.h trunk/complement/explore/perf/alloc/suite.cc Modified: trunk/complement/explore/perf/alloc/alloc_perf_suite.cc =================================================================== --- trunk/complement/explore/perf/alloc/alloc_perf_suite.cc 2008-08-12 14:08:09 UTC (rev 1956) +++ trunk/complement/explore/perf/alloc/alloc_perf_suite.cc 2008-08-12 14:32:04 UTC (rev 1957) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <08/08/12 18:06:06 yeti> +// -*- C++ -*- Time-stamp: <08/08/12 18:28:14 yeti> /* * Copyright (c) 2008 @@ -21,3 +21,28 @@ return 0; } + +int EXAM_IMPL(alloc_test::alloc5000) +{ + for ( int i = 0; i < 10000; ++i ) { + if ( malloc( 5000 ) == 0 ) { + return 1; + } + } + + return 0; +} + +int EXAM_IMPL(alloc_test::alloc_mix) +{ + for ( int i = 0; i < 5000; ++i ) { + if ( malloc( 5000 ) == 0 ) { + return 1; + } + if ( malloc( 100 ) == 0 ) { + return 1; + } + } + + return 0; +} Modified: trunk/complement/explore/perf/alloc/alloc_perf_suite.h =================================================================== --- trunk/complement/explore/perf/alloc/alloc_perf_suite.h 2008-08-12 14:08:09 UTC (rev 1956) +++ trunk/complement/explore/perf/alloc/alloc_perf_suite.h 2008-08-12 14:32:04 UTC (rev 1957) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <08/08/12 16:51:28 yeti> +// -*- C++ -*- Time-stamp: <08/08/12 18:28:37 yeti> /* * Copyright (c) 2008 @@ -16,6 +16,8 @@ { public: int EXAM_DECL(alloc); + int EXAM_DECL(alloc5000); + int EXAM_DECL(alloc_mix); }; #endif // __ALLOC_PERF_SUITE_H Modified: trunk/complement/explore/perf/alloc/suite.cc =================================================================== --- trunk/complement/explore/perf/alloc/suite.cc 2008-08-12 14:08:09 UTC (rev 1956) +++ trunk/complement/explore/perf/alloc/suite.cc 2008-08-12 14:32:04 UTC (rev 1957) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <08/08/12 16:48:21 yeti> +// -*- C++ -*- Time-stamp: <08/08/12 18:27:28 yeti> /* * Copyright (c) 2008 @@ -25,6 +25,8 @@ alloc_test alt; t.add( &alloc_test::alloc, alt, "malloc" ); + t.add( &alloc_test::alloc5000, alt, "malloc 5000" ); + t.add( &alloc_test::alloc_mix, alt, "malloc mix" ); return t.girdle(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |