File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -344,6 +344,7 @@ void test_external_pointer_large()
344344
345345void test_external_pointer_dealloc_bug ()
346346{
347+ std::cout << " Testing external pointer dealloc bug" << std::endl;
347348 auto & alloc = ThreadAlloc::get ();
348349 constexpr size_t count = MIN_CHUNK_SIZE;
349350 void * allocs[count];
@@ -364,6 +365,29 @@ void test_external_pointer_dealloc_bug()
364365 }
365366
366367 alloc.dealloc (allocs[0 ]);
368+ std::cout << " Testing external pointer dealloc bug - done" << std::endl;
369+ }
370+
371+ void test_external_pointer_stack ()
372+ {
373+ std::cout << " Testing external pointer stack" << std::endl;
374+
375+ std::array<int , 2000 > stack;
376+
377+ auto & alloc = ThreadAlloc::get ();
378+
379+ for (size_t i = 0 ; i < stack.size (); i++)
380+ {
381+ if (alloc.external_pointer (&stack[i]) > &stack[i])
382+ {
383+ std::cout << " Stack pointer: " << &stack[i]
384+ << " external pointer: " << alloc.external_pointer (&stack[i])
385+ << std::endl;
386+ abort ();
387+ }
388+ }
389+
390+ std::cout << " Testing external pointer stack - done" << std::endl;
367391}
368392
369393void test_alloc_16M ()
@@ -500,6 +524,7 @@ int main(int argc, char** argv)
500524 test_remaining_bytes ();
501525 test_static_sized_allocs ();
502526 test_calloc_large_bug ();
527+ test_external_pointer_stack ();
503528 test_external_pointer_dealloc_bug ();
504529 test_external_pointer_large ();
505530 test_external_pointer ();
You can’t perform that action at this time.
0 commit comments