Skip to content

Commit

Permalink
Increase shared memory size for container tests
Browse files Browse the repository at this point in the history
  • Loading branch information
igaztanaga committed Jan 6, 2024
1 parent 38a03cc commit 0191a31
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions test/deque_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool do_test()
//Alias deque types
typedef deque<IntType, shmem_allocator_t> MyShmDeque;
typedef std::deque<int> MyStdDeque;
const int Memsize = 65536;
const int Memsize = 128u*1024u;
const char *const shMemName = test::get_process_id_name();
const int max = 100;

Expand All @@ -130,7 +130,7 @@ bool do_test()
//Create shared memory
my_managed_shared_memory segment(create_only, shMemName, Memsize);

segment.reserve_named_objects(100);
segment.reserve_named_objects(10);

//Shared memory allocator must be always be initialized
//since it has no default constructor
Expand Down
6 changes: 3 additions & 3 deletions test/list_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ int list_test (bool copied_allocators_equal = true)
{
typedef std::list<int> MyStdList;
typedef typename MyShmList::value_type IntType;
const int memsize = 65536;
const int Memsize = 128u * 1024u;
const char *const shMemName = test::get_process_id_name();
const int max = 100;
typedef push_data_function<DoublyLinked> push_data_t;
Expand All @@ -107,9 +107,9 @@ int list_test (bool copied_allocators_equal = true)
//Named new capable shared mem allocator
//Create shared memory
shared_memory_object::remove(shMemName);
ManagedSharedMemory segment(create_only, shMemName, memsize);
ManagedSharedMemory segment(create_only, shMemName, Memsize);

segment.reserve_named_objects(100);
segment.reserve_named_objects(10);

//Shared memory allocator must be always be initialized
//since it has no default constructor
Expand Down
12 changes: 6 additions & 6 deletions test/map_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ int map_test ()
typedef typename MyShmMap::key_type IntType;
typedef boost::interprocess::pair<IntType, IntType> IntPairType;
typedef typename MyStdMap::value_type StdPairType;
const int memsize = 65536;
const int Memsize = 128u * 1024u;
const char *const shMemName = test::get_process_id_name();
const int max = 100;

BOOST_TRY{
//Create shared memory
shared_memory_object::remove(shMemName);
ManagedSharedMemory segment(create_only, shMemName, memsize);
ManagedSharedMemory segment(create_only, shMemName, Memsize);

segment.reserve_named_objects(100);
segment.reserve_named_objects(10);

//Shared memory allocator must be always be initialized
//since it has no default constructor
Expand Down Expand Up @@ -503,16 +503,16 @@ int map_test_copyable ()
typedef boost::interprocess::pair<IntType, IntType> IntPairType;
typedef typename MyStdMap::value_type StdPairType;

const int memsize = 65536;
const int Memsize = 128u * 1024u;
const char *const shMemName = test::get_process_id_name();
const int max = 100;

BOOST_TRY{
//Create shared memory
shared_memory_object::remove(shMemName);
ManagedSharedMemory segment(create_only, shMemName, memsize);
ManagedSharedMemory segment(create_only, shMemName, Memsize);

segment.reserve_named_objects(100);
segment.reserve_named_objects(10);

//Shared memory allocator must be always be initialized
//since it has no default constructor
Expand Down
12 changes: 6 additions & 6 deletions test/set_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ template<class ManagedSharedMemory
int set_test ()
{
typedef typename MyShmSet::value_type IntType;
const int memsize = 65536;
const int Memsize = 128u * 1024u;
const char *const shMemName = test::get_process_id_name();
const int max = 100;

BOOST_TRY{
//Create shared memory
shared_memory_object::remove(shMemName);
ManagedSharedMemory segment(create_only, shMemName, memsize);
ManagedSharedMemory segment(create_only, shMemName, Memsize);

segment.reserve_named_objects(100);
segment.reserve_named_objects(10);

//Shared memory allocator must be always be initialized
//since it has no default constructor
Expand Down Expand Up @@ -508,16 +508,16 @@ template<class ManagedSharedMemory
int set_test_copyable ()
{
typedef typename MyShmSet::value_type IntType;
const int memsize = 65536;
const int Memsize = 128u * 1024u;
const char *const shMemName = test::get_process_id_name();
const int max = 100;

BOOST_TRY{
//Create shared memory
shared_memory_object::remove(shMemName);
ManagedSharedMemory segment(create_only, shMemName, memsize);
ManagedSharedMemory segment(create_only, shMemName, Memsize);

segment.reserve_named_objects(100);
segment.reserve_named_objects(10);

//Shared memory allocator must be always be initialized
//since it has no default constructor
Expand Down
4 changes: 2 additions & 2 deletions test/vector_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int vector_test()
std::string process_name;
test::get_process_id_name(process_name);

const int Memsize = 65536;
const int Memsize = 128u*1024u;
const char *const shMemName = process_name.c_str();
const int max = 100;

Expand All @@ -92,7 +92,7 @@ int vector_test()
BOOST_TRY{
ManagedSharedMemory segment(create_only, shMemName, Memsize);

segment.reserve_named_objects(100);
segment.reserve_named_objects(10);

//Shared memory allocator must be always be initialized
//since it has no default constructor
Expand Down

0 comments on commit 0191a31

Please sign in to comment.