Stxxl  1.4.0
containers/test_many_stacks.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002  *  containers/test_many_stacks.cpp
00003  *
00004  *  Part of the STXXL. See http://stxxl.sourceforge.net
00005  *
00006  *  Copyright (C) 2003 Roman Dementiev <dementiev@mpi-sb.mpg.de>
00007  *
00008  *  Distributed under the Boost Software License, Version 1.0.
00009  *  (See accompanying file LICENSE_1_0.txt or copy at
00010  *  http://www.boost.org/LICENSE_1_0.txt)
00011  **************************************************************************/
00012 
00013 //! \example containers/test_many_stacks.cpp
00014 //! This is an example of how to use \c stxxl::STACK_GENERATOR class
00015 //! to generate an \b external stack type
00016 //! with \c stxxl::grow_shrink_stack implementation, \b four blocks per page,
00017 //! block size \b 4096 bytes
00018 
00019 
00020 #include <stxxl/stack>
00021 
00022 
00023 int main(int argc, char * argv[])
00024 {
00025     typedef stxxl::STACK_GENERATOR<int, stxxl::external, stxxl::normal, 4, 4096>::result ext_stack_type;
00026 
00027     if (argc < 2)
00028     {
00029         STXXL_MSG("Usage: " << argv[0] << " number_of_stacks");
00030         return -1;
00031     }
00032 
00033     ext_stack_type * my_stacks = new ext_stack_type[atoi(argv[1])];
00034 
00035     delete[] my_stacks;
00036 
00037     return 0;
00038 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines