Commit eb530cab by Jonathan Wakely Committed by Jonathan Wakely

Fix test bug with mismatched alignment in allocate/deallocate

	* testsuite/experimental/memory_resource/new_delete_resource.cc: Fix
	test by passing correct alignment to deallocate function.

From-SVN: r271408
parent 2754b50b
2019-05-20 Jonathan Wakely <jwakely@redhat.com>
* testsuite/experimental/memory_resource/new_delete_resource.cc: Fix
test by passing correct alignment to deallocate function.
2019-05-18 Jonathan Wakely <jwakely@redhat.com> 2019-05-18 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/90520 PR libstdc++/90520
......
...@@ -103,7 +103,6 @@ test02() ...@@ -103,7 +103,6 @@ test02()
void void
test03() test03()
{ {
using std::max_align_t; using std::max_align_t;
using std::size_t; using std::size_t;
...@@ -123,7 +122,8 @@ test03() ...@@ -123,7 +122,8 @@ test03()
p = r1->allocate(2, alignof(char)); p = r1->allocate(2, alignof(char));
VERIFY( bytes_allocated == 2 ); VERIFY( bytes_allocated == 2 );
VERIFY( aligned<max_align_t>(p) ); VERIFY( aligned<max_align_t>(p) );
r1->deallocate(p, 2); r1->deallocate(p, 2, alignof(char));
__builtin_printf("%d\n", (int)bytes_allocated);
VERIFY( bytes_allocated == 0 ); VERIFY( bytes_allocated == 0 );
p = r1->allocate(3, alignof(short)); p = r1->allocate(3, alignof(short));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment