1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2006-2012. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/interprocess for documentation.
9 //////////////////////////////////////////////////////////////////////////////
11 #ifndef BOOST_INTERPROCESS_TEST_MEMORY_ALGORITHM_TEST_TEMPLATE_HEADER
12 #define BOOST_INTERPROCESS_TEST_MEMORY_ALGORITHM_TEST_TEMPLATE_HEADER
14 #include <boost/interprocess/detail/config_begin.hpp>
16 #include <boost/interprocess/containers/vector.hpp>
20 #include <new> //std::nothrow
21 #include <cstring> //std::memset
23 namespace boost { namespace interprocess { namespace test {
25 enum deallocation_type { DirectDeallocation, InverseDeallocation, MixedDeallocation, EndDeallocationType };
27 //This test allocates until there is no more memory
28 //and after that deallocates all in the inverse order
29 template<class Allocator>
30 bool test_allocation(Allocator &a)
32 for( deallocation_type t = DirectDeallocation
33 ; t != EndDeallocationType
34 ; t = (deallocation_type)((int)t + 1)){
35 std::vector<void*> buffers;
36 typename Allocator::size_type free_memory = a.get_free_memory();
38 for(int i = 0; true; ++i){
39 void *ptr = a.allocate(i, std::nothrow);
42 std::size_t size = a.size(ptr);
43 std::memset(ptr, 0, size);
44 buffers.push_back(ptr);
48 case DirectDeallocation:
50 for(int j = 0, max = (int)buffers.size()
53 a.deallocate(buffers[j]);
57 case InverseDeallocation:
59 for(int j = (int)buffers.size()
62 a.deallocate(buffers[j]);
66 case MixedDeallocation:
68 for(int j = 0, max = (int)buffers.size()
71 int pos = (j%4)*((int)buffers.size())/4;
72 a.deallocate(buffers[pos]);
73 buffers.erase(buffers.begin()+pos);
80 bool ok = free_memory == a.get_free_memory() &&
81 a.all_memory_deallocated() && a.check_sanity();
87 //This test allocates until there is no more memory
88 //and after that tries to shrink all the buffers to the
89 //half of the original size
90 template<class Allocator>
91 bool test_allocation_shrink(Allocator &a)
93 std::vector<void*> buffers;
95 //Allocate buffers with extra memory
96 for(int i = 0; true; ++i){
97 void *ptr = a.allocate(i*2, std::nothrow);
100 std::size_t size = a.size(ptr);
101 std::memset(ptr, 0, size);
102 buffers.push_back(ptr);
106 for(int i = 0, max = (int)buffers.size()
109 typename Allocator::size_type received_size;
110 char *reuse = static_cast<char*>(buffers[i]);
111 if(a.template allocation_command<char>
112 ( boost::interprocess::shrink_in_place | boost::interprocess::nothrow_allocation, i*2
113 , received_size = i, reuse)){
114 if(received_size > std::size_t(i*2)){
117 if(received_size < std::size_t(i)){
120 std::memset(buffers[i], 0, a.size(buffers[i]));
124 //Deallocate it in non sequential order
125 for(int j = 0, max = (int)buffers.size()
128 int pos = (j%4)*((int)buffers.size())/4;
129 a.deallocate(buffers[pos]);
130 buffers.erase(buffers.begin()+pos);
133 return a.all_memory_deallocated() && a.check_sanity();
136 //This test allocates until there is no more memory
137 //and after that tries to expand all the buffers to
138 //avoid the wasted internal fragmentation
139 template<class Allocator>
140 bool test_allocation_expand(Allocator &a)
142 std::vector<void*> buffers;
144 //Allocate buffers with extra memory
145 for(int i = 0; true; ++i){
146 void *ptr = a.allocate(i, std::nothrow);
149 std::size_t size = a.size(ptr);
150 std::memset(ptr, 0, size);
151 buffers.push_back(ptr);
154 //Now try to expand to the double of the size
155 for(int i = 0, max = (int)buffers.size()
158 typename Allocator::size_type received_size;
159 std::size_t min_size = i+1;
160 std::size_t preferred_size = i*2;
161 preferred_size = min_size > preferred_size ? min_size : preferred_size;
163 char *reuse = static_cast<char*>(buffers[i]);
164 while(a.template allocation_command<char>
165 ( boost::interprocess::expand_fwd | boost::interprocess::nothrow_allocation, min_size
166 , received_size = preferred_size, reuse)){
167 //Check received size is bigger than minimum
168 if(received_size < min_size){
171 //Now, try to expand further
172 min_size = received_size+1;
173 preferred_size = min_size*2;
177 //Deallocate it in non sequential order
178 for(int j = 0, max = (int)buffers.size()
181 int pos = (j%4)*((int)buffers.size())/4;
182 a.deallocate(buffers[pos]);
183 buffers.erase(buffers.begin()+pos);
186 return a.all_memory_deallocated() && a.check_sanity();
189 //This test allocates until there is no more memory
190 //and after that tries to expand all the buffers to
191 //avoid the wasted internal fragmentation
192 template<class Allocator>
193 bool test_allocation_shrink_and_expand(Allocator &a)
195 std::vector<void*> buffers;
196 std::vector<typename Allocator::size_type> received_sizes;
197 std::vector<bool> size_reduced;
199 //Allocate buffers wand store received sizes
200 for(int i = 0; true; ++i){
201 typename Allocator::size_type received_size;
203 void *ptr = a.template allocation_command<char>
204 ( boost::interprocess::allocate_new | boost::interprocess::nothrow_allocation, i, received_size = i*2, reuse);
206 ptr = a.template allocation_command<char>
207 ( boost::interprocess::allocate_new | boost::interprocess::nothrow_allocation, 1, received_size = i*2, reuse);
211 buffers.push_back(ptr);
212 received_sizes.push_back(received_size);
216 for(int i = 0, max = (int)buffers.size()
219 typename Allocator::size_type received_size;
220 char *reuse = static_cast<char*>(buffers[i]);
221 if(a.template allocation_command<char>
222 ( boost::interprocess::shrink_in_place | boost::interprocess::nothrow_allocation, received_sizes[i]
223 , received_size = i, reuse)){
224 if(received_size > std::size_t(received_sizes[i])){
227 if(received_size < std::size_t(i)){
230 size_reduced.push_back(received_size != received_sizes[i]);
234 //Now try to expand to the original size
235 for(int i = 0, max = (int)buffers.size()
238 typename Allocator::size_type received_size;
239 std::size_t request_size = received_sizes[i];
240 char *reuse = static_cast<char*>(buffers[i]);
241 if(a.template allocation_command<char>
242 ( boost::interprocess::expand_fwd | boost::interprocess::nothrow_allocation, request_size
243 , received_size = request_size, reuse)){
244 if(received_size != received_sizes[i]){
253 //Deallocate it in non sequential order
254 for(int j = 0, max = (int)buffers.size()
257 int pos = (j%4)*((int)buffers.size())/4;
258 a.deallocate(buffers[pos]);
259 buffers.erase(buffers.begin()+pos);
262 return a.all_memory_deallocated() && a.check_sanity();
265 //This test allocates until there is no more memory
266 //and after that deallocates the odd buffers to
267 //make room for expansions. The expansion will probably
268 //success since the deallocation left room for that.
269 template<class Allocator>
270 bool test_allocation_deallocation_expand(Allocator &a)
272 std::vector<void*> buffers;
274 //Allocate buffers with extra memory
275 for(int i = 0; true; ++i){
276 void *ptr = a.allocate(i, std::nothrow);
279 std::size_t size = a.size(ptr);
280 std::memset(ptr, 0, size);
281 buffers.push_back(ptr);
284 //Now deallocate the half of the blocks
285 //so expand maybe can merge new free blocks
286 for(int i = 0, max = (int)buffers.size()
290 a.deallocate(buffers[i]);
295 //Now try to expand to the double of the size
296 for(int i = 0, max = (int)buffers.size()
301 typename Allocator::size_type received_size;
302 std::size_t min_size = i+1;
303 std::size_t preferred_size = i*2;
304 preferred_size = min_size > preferred_size ? min_size : preferred_size;
306 char *reuse = static_cast<char*>(buffers[i]);
307 while(a.template allocation_command<char>
308 ( boost::interprocess::expand_fwd | boost::interprocess::nothrow_allocation, min_size
309 , received_size = preferred_size, reuse)){
310 //Check received size is bigger than minimum
311 if(received_size < min_size){
314 //Now, try to expand further
315 min_size = received_size+1;
316 preferred_size = min_size*2;
321 //Now erase null values from the vector
322 buffers.erase( std::remove(buffers.begin(), buffers.end(), static_cast<void*>(0))
325 //Deallocate it in non sequential order
326 for(int j = 0, max = (int)buffers.size()
329 int pos = (j%4)*((int)buffers.size())/4;
330 a.deallocate(buffers[pos]);
331 buffers.erase(buffers.begin()+pos);
334 return a.all_memory_deallocated() && a.check_sanity();
337 //This test allocates until there is no more memory
338 //and after that deallocates all except the last.
339 //If the allocation algorithm is a bottom-up algorithm
340 //the last buffer will be in the end of the segment.
341 //Then the test will start expanding backwards, until
342 //the buffer fills all the memory
343 template<class Allocator>
344 bool test_allocation_with_reuse(Allocator &a)
346 //We will repeat this test for different sized elements
347 for(int sizeof_object = 1; sizeof_object < 20; ++sizeof_object){
348 std::vector<void*> buffers;
350 //Allocate buffers with extra memory
351 for(int i = 0; true; ++i){
352 void *ptr = a.allocate(i*sizeof_object, std::nothrow);
355 std::size_t size = a.size(ptr);
356 std::memset(ptr, 0, size);
357 buffers.push_back(ptr);
360 //Now deallocate all except the latest
361 //Now try to expand to the double of the sizeof_object
362 for(int i = 0, max = (int)buffers.size() - 1
365 a.deallocate(buffers[i]);
368 //Save the unique buffer and clear vector
369 void *ptr = buffers.back();
372 //Now allocate with reuse
373 typename Allocator::size_type received_size = 0;
374 for(int i = 0; true; ++i){
375 std::size_t min_size = (received_size + 1);
376 std::size_t prf_size = (received_size + (i+1)*2);
378 void *ret = a.raw_allocation_command
379 ( boost::interprocess::expand_bwd | boost::interprocess::nothrow_allocation, min_size
380 , received_size = prf_size, reuse, sizeof_object);
383 //If we have memory, this must be a buffer reuse
386 if(received_size < min_size)
390 //There is only a single block so deallocate it
393 if(!a.all_memory_deallocated() || !a.check_sanity())
400 //This test allocates memory with different alignments
401 //and checks returned memory is aligned.
402 template<class Allocator>
403 bool test_aligned_allocation(Allocator &a)
405 //Allocate aligned buffers in a loop
406 //and then deallocate it
407 bool continue_loop = true;
408 for(unsigned int i = 1; continue_loop; i <<= 1){
409 for(unsigned int j = 1; true; j <<= 1){
410 void *ptr = a.allocate_aligned(i-1, j, std::nothrow);
413 continue_loop = false;
417 if(((std::size_t)ptr & (j - 1)) != 0)
420 if(!a.all_memory_deallocated() || !a.check_sanity()){
426 return a.all_memory_deallocated() && a.check_sanity();
429 //This test allocates memory with different alignments
430 //and checks returned memory is aligned.
431 template<class Allocator>
432 bool test_continuous_aligned_allocation(Allocator &a)
434 std::vector<void*> buffers;
435 //Allocate aligned buffers in a loop
436 //and then deallocate it
437 bool continue_loop = true;
438 for(unsigned i = 1; continue_loop && i; i <<= 1){
439 for(unsigned int j = 1; j; j <<= 1){
440 for(bool any_allocated = false; 1;){
441 void *ptr = a.allocate_aligned(i-1, j, std::nothrow);
442 buffers.push_back(ptr);
444 if(j == 1 && !any_allocated){
445 continue_loop = false;
450 any_allocated = true;
453 if(((std::size_t)ptr & (j - 1)) != 0)
457 for(unsigned int k = (int)buffers.size(); k--;){
458 a.deallocate(buffers[k]);
461 if(!a.all_memory_deallocated() && a.check_sanity())
468 return a.all_memory_deallocated() && a.check_sanity();
471 //This test allocates memory, writes it with a non-zero value and
472 //tests zero_free_memory initializes to zero for the next allocation
473 template<class Allocator>
474 bool test_clear_free_memory(Allocator &a)
476 std::vector<void*> buffers;
479 for(int i = 0; true; ++i){
480 void *ptr = a.allocate(i, std::nothrow);
483 std::size_t size = a.size(ptr);
484 std::memset(ptr, 1, size);
485 buffers.push_back(ptr);
489 for(int i = 0, max = buffers.size(); i < max; ++i){
490 std::memset(buffers[i], 1, i);
494 for(int j = (int)buffers.size()
497 a.deallocate(buffers[j]);
501 if(!a.all_memory_deallocated() && a.check_sanity())
504 //Now clear all free memory
505 a.zero_free_memory();
507 if(!a.all_memory_deallocated() && a.check_sanity())
510 //Now test all allocated memory is zero
512 const char *first_addr = 0;
513 for(int i = 0; true; ++i){
514 void *ptr = a.allocate(i, std::nothrow);
518 first_addr = (char*)ptr;
520 std::size_t memsize = a.size(ptr);
521 buffers.push_back(ptr);
523 for(int j = 0; j < (int)memsize; ++j){
524 if(static_cast<char*>((char*)ptr)[j]){
525 std::cout << "Zero memory test failed. in buffer " << i
526 << " byte " << j << " first address " << (void*) first_addr << " offset " << ((char*)ptr+j) - (char*)first_addr << " memsize: " << memsize << std::endl;
533 for(int j = (int)buffers.size()
536 a.deallocate(buffers[j]);
538 if(!a.all_memory_deallocated() && a.check_sanity())
545 //This test uses tests grow and shrink_to_fit functions
546 template<class Allocator>
547 bool test_grow_shrink_to_fit(Allocator &a)
549 std::vector<void*> buffers;
551 typename Allocator::size_type original_size = a.get_size();
552 typename Allocator::size_type original_free = a.get_free_memory();
556 if(!a.all_memory_deallocated() && a.check_sanity())
559 typename Allocator::size_type shrunk_size = a.get_size();
560 typename Allocator::size_type shrunk_free_memory = a.get_free_memory();
561 if(shrunk_size != a.get_min_size())
564 a.grow(original_size - shrunk_size);
566 if(!a.all_memory_deallocated() && a.check_sanity())
569 if(original_size != a.get_size())
571 if(original_free != a.get_free_memory())
575 for(int i = 0; true; ++i){
576 void *ptr = a.allocate(i, std::nothrow);
579 std::size_t size = a.size(ptr);
580 std::memset(ptr, 0, size);
581 buffers.push_back(ptr);
584 //Now deallocate the half of the blocks
585 //so expand maybe can merge new free blocks
586 for(int i = 0, max = (int)buffers.size()
590 a.deallocate(buffers[i]);
595 //Deallocate the rest of the blocks
597 //Deallocate it in non sequential order
598 for(int j = 0, max = (int)buffers.size()
601 int pos = (j%5)*((int)buffers.size())/4;
602 if(pos == int(buffers.size()))
604 a.deallocate(buffers[pos]);
605 buffers.erase(buffers.begin()+pos);
606 typename Allocator::size_type old_free = a.get_free_memory();
608 if(!a.check_sanity()) return false;
609 if(original_size < a.get_size()) return false;
610 if(old_free < a.get_free_memory()) return false;
612 a.grow(original_size - a.get_size());
614 if(!a.check_sanity()) return false;
615 if(original_size != a.get_size()) return false;
616 if(old_free != a.get_free_memory()) return false;
619 //Now shrink it to the maximum
622 if(a.get_size() != a.get_min_size())
625 if(shrunk_free_memory != a.get_free_memory())
628 if(!a.all_memory_deallocated() && a.check_sanity())
631 a.grow(original_size - shrunk_size);
633 if(original_size != a.get_size())
635 if(original_free != a.get_free_memory())
638 if(!a.all_memory_deallocated() && a.check_sanity())
643 //This test allocates multiple values until there is no more memory
644 //and after that deallocates all in the inverse order
645 template<class Allocator>
646 bool test_many_equal_allocation(Allocator &a)
648 for( deallocation_type t = DirectDeallocation
649 ; t != EndDeallocationType
650 ; t = (deallocation_type)((int)t + 1)){
651 typename Allocator::size_type free_memory = a.get_free_memory();
653 std::vector<void*> buffers2;
655 //Allocate buffers with extra memory
656 for(int i = 0; true; ++i){
657 void *ptr = a.allocate(i, std::nothrow);
660 std::size_t size = a.size(ptr);
661 std::memset(ptr, 0, size);
662 if(!a.check_sanity())
664 buffers2.push_back(ptr);
667 //Now deallocate the half of the blocks
668 //so expand maybe can merge new free blocks
669 for(int i = 0, max = (int)buffers2.size()
673 a.deallocate(buffers2[i]);
678 if(!a.check_sanity())
681 typedef typename Allocator::multiallocation_chain multiallocation_chain;
682 std::vector<void*> buffers;
683 for(int i = 0; true; ++i){
684 multiallocation_chain chain;
685 a.allocate_many(std::nothrow, i+1, (i+1)*2, chain);
689 typename multiallocation_chain::size_type n = chain.size();
690 while(!chain.empty()){
691 buffers.push_back(ipcdetail::to_raw_pointer(chain.pop_front()));
693 if(n != std::size_t((i+1)*2))
697 if(!a.check_sanity())
701 case DirectDeallocation:
703 for(int j = 0, max = (int)buffers.size()
706 a.deallocate(buffers[j]);
710 case InverseDeallocation:
712 for(int j = (int)buffers.size()
715 a.deallocate(buffers[j]);
719 case MixedDeallocation:
721 for(int j = 0, max = (int)buffers.size()
724 int pos = (j%4)*((int)buffers.size())/4;
725 a.deallocate(buffers[pos]);
726 buffers.erase(buffers.begin()+pos);
734 //Deallocate the rest of the blocks
736 //Deallocate it in non sequential order
737 for(int j = 0, max = (int)buffers2.size()
740 int pos = (j%4)*((int)buffers2.size())/4;
741 a.deallocate(buffers2[pos]);
742 buffers2.erase(buffers2.begin()+pos);
745 bool ok = free_memory == a.get_free_memory() &&
746 a.all_memory_deallocated() && a.check_sanity();
752 //This test allocates multiple values until there is no more memory
753 //and after that deallocates all in the inverse order
754 template<class Allocator>
755 bool test_many_different_allocation(Allocator &a)
757 typedef typename Allocator::multiallocation_chain multiallocation_chain;
758 const std::size_t ArraySize = 11;
759 typename Allocator::size_type requested_sizes[ArraySize];
760 for(std::size_t i = 0; i < ArraySize; ++i){
761 requested_sizes[i] = 4*i;
764 for( deallocation_type t = DirectDeallocation
765 ; t != EndDeallocationType
766 ; t = (deallocation_type)((int)t + 1)){
767 typename Allocator::size_type free_memory = a.get_free_memory();
769 std::vector<void*> buffers2;
771 //Allocate buffers with extra memory
772 for(int i = 0; true; ++i){
773 void *ptr = a.allocate(i, std::nothrow);
776 std::size_t size = a.size(ptr);
777 std::memset(ptr, 0, size);
778 buffers2.push_back(ptr);
781 //Now deallocate the half of the blocks
782 //so expand maybe can merge new free blocks
783 for(int i = 0, max = (int)buffers2.size()
787 a.deallocate(buffers2[i]);
792 std::vector<void*> buffers;
793 for(int i = 0; true; ++i){
794 multiallocation_chain chain;
795 a.allocate_many(std::nothrow, requested_sizes, ArraySize, 1, chain);
798 typename multiallocation_chain::size_type n = chain.size();
799 while(!chain.empty()){
800 buffers.push_back(ipcdetail::to_raw_pointer(chain.pop_front()));
807 case DirectDeallocation:
809 for(int j = 0, max = (int)buffers.size()
812 a.deallocate(buffers[j]);
816 case InverseDeallocation:
818 for(int j = (int)buffers.size()
821 a.deallocate(buffers[j]);
825 case MixedDeallocation:
827 for(int j = 0, max = (int)buffers.size()
830 int pos = (j%4)*((int)buffers.size())/4;
831 a.deallocate(buffers[pos]);
832 buffers.erase(buffers.begin()+pos);
840 //Deallocate the rest of the blocks
842 //Deallocate it in non sequential order
843 for(int j = 0, max = (int)buffers2.size()
846 int pos = (j%4)*((int)buffers2.size())/4;
847 a.deallocate(buffers2[pos]);
848 buffers2.erase(buffers2.begin()+pos);
851 bool ok = free_memory == a.get_free_memory() &&
852 a.all_memory_deallocated() && a.check_sanity();
858 //This test allocates multiple values until there is no more memory
859 //and after that deallocates all in the inverse order
860 template<class Allocator>
861 bool test_many_deallocation(Allocator &a)
863 typedef typename Allocator::multiallocation_chain multiallocation_chain;
865 typedef typename Allocator::multiallocation_chain multiallocation_chain;
866 const std::size_t ArraySize = 11;
867 vector<multiallocation_chain> buffers;
868 typename Allocator::size_type requested_sizes[ArraySize];
869 for(std::size_t i = 0; i < ArraySize; ++i){
870 requested_sizes[i] = 4*i;
872 typename Allocator::size_type free_memory = a.get_free_memory();
875 for(int i = 0; true; ++i){
876 multiallocation_chain chain;
877 a.allocate_many(std::nothrow, requested_sizes, ArraySize, 1, chain);
880 buffers.push_back(boost::move(chain));
882 for(int i = 0, max = (int)buffers.size(); i != max; ++i){
883 a.deallocate_many(buffers[i]);
886 bool ok = free_memory == a.get_free_memory() &&
887 a.all_memory_deallocated() && a.check_sanity();
892 for(int i = 0; true; ++i){
893 multiallocation_chain chain;
894 a.allocate_many(std::nothrow, i*4, ArraySize, chain);
897 buffers.push_back(boost::move(chain));
899 for(int i = 0, max = (int)buffers.size(); i != max; ++i){
900 a.deallocate_many(buffers[i]);
904 bool ok = free_memory == a.get_free_memory() &&
905 a.all_memory_deallocated() && a.check_sanity();
913 //This function calls all tests
914 template<class Allocator>
915 bool test_all_allocation(Allocator &a)
917 std::cout << "Starting test_allocation. Class: "
918 << typeid(a).name() << std::endl;
920 if(!test_allocation(a)){
921 std::cout << "test_allocation_direct_deallocation failed. Class: "
922 << typeid(a).name() << std::endl;
926 std::cout << "Starting test_many_equal_allocation. Class: "
927 << typeid(a).name() << std::endl;
929 if(!test_many_equal_allocation(a)){
930 std::cout << "test_many_equal_allocation failed. Class: "
931 << typeid(a).name() << std::endl;
935 std::cout << "Starting test_many_different_allocation. Class: "
936 << typeid(a).name() << std::endl;
938 if(!test_many_different_allocation(a)){
939 std::cout << "test_many_different_allocation failed. Class: "
940 << typeid(a).name() << std::endl;
944 if(!test_many_deallocation(a)){
945 std::cout << "test_many_deallocation failed. Class: "
946 << typeid(a).name() << std::endl;
950 std::cout << "Starting test_allocation_shrink. Class: "
951 << typeid(a).name() << std::endl;
953 if(!test_allocation_shrink(a)){
954 std::cout << "test_allocation_shrink failed. Class: "
955 << typeid(a).name() << std::endl;
959 if(!test_allocation_shrink_and_expand(a)){
960 std::cout << "test_allocation_shrink_and_expand failed. Class: "
961 << typeid(a).name() << std::endl;
965 std::cout << "Starting test_allocation_expand. Class: "
966 << typeid(a).name() << std::endl;
968 if(!test_allocation_expand(a)){
969 std::cout << "test_allocation_expand failed. Class: "
970 << typeid(a).name() << std::endl;
974 std::cout << "Starting test_allocation_deallocation_expand. Class: "
975 << typeid(a).name() << std::endl;
977 if(!test_allocation_deallocation_expand(a)){
978 std::cout << "test_allocation_deallocation_expand failed. Class: "
979 << typeid(a).name() << std::endl;
983 std::cout << "Starting test_allocation_with_reuse. Class: "
984 << typeid(a).name() << std::endl;
986 if(!test_allocation_with_reuse(a)){
987 std::cout << "test_allocation_with_reuse failed. Class: "
988 << typeid(a).name() << std::endl;
992 std::cout << "Starting test_aligned_allocation. Class: "
993 << typeid(a).name() << std::endl;
995 if(!test_aligned_allocation(a)){
996 std::cout << "test_aligned_allocation failed. Class: "
997 << typeid(a).name() << std::endl;
1001 std::cout << "Starting test_continuous_aligned_allocation. Class: "
1002 << typeid(a).name() << std::endl;
1004 if(!test_continuous_aligned_allocation(a)){
1005 std::cout << "test_continuous_aligned_allocation failed. Class: "
1006 << typeid(a).name() << std::endl;
1010 std::cout << "Starting test_clear_free_memory. Class: "
1011 << typeid(a).name() << std::endl;
1013 if(!test_clear_free_memory(a)){
1014 std::cout << "test_clear_free_memory failed. Class: "
1015 << typeid(a).name() << std::endl;
1019 std::cout << "Starting test_grow_shrink_to_fit. Class: "
1020 << typeid(a).name() << std::endl;
1022 if(!test_grow_shrink_to_fit(a)){
1023 std::cout << "test_grow_shrink_to_fit failed. Class: "
1024 << typeid(a).name() << std::endl;
1031 }}} //namespace boost { namespace interprocess { namespace test {
1033 #include <boost/interprocess/detail/config_end.hpp>
1035 #endif //BOOST_INTERPROCESS_TEST_MEMORY_ALGORITHM_TEST_TEMPLATE_HEADER