File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
compiler-rt/lib/scudo/standalone/tests Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -679,3 +679,23 @@ SCUDO_TYPED_TEST(ScudoCombinedTest, DisableMemInit) {
679
679
680
680
Allocator->setOption (scudo::Option::ThreadDisableMemInit, 0 );
681
681
}
682
+
683
+ SCUDO_TYPED_TEST (ScudoCombinedTest, ReallocateInPlaceStress) {
684
+ auto *Allocator = this ->Allocator .get ();
685
+
686
+ // Regression test: make realloc-in-place happen at the very right end of a
687
+ // mapped region.
688
+ constexpr int nPtrs = 10000 ;
689
+ for (int i = 1 ; i < 32 ; ++i) {
690
+ scudo::uptr Size = 16 * i - 1 ;
691
+ std::vector<void *> Ptrs;
692
+ for (int i = 0 ; i < nPtrs; ++i) {
693
+ void *P = Allocator->allocate (Size, Origin);
694
+ P = Allocator->reallocate (P, Size + 1 );
695
+ Ptrs.push_back (P);
696
+ }
697
+
698
+ for (int i = 0 ; i < nPtrs; ++i)
699
+ Allocator->deallocate (Ptrs[i], Origin);
700
+ }
701
+ }
You can’t perform that action at this time.
0 commit comments