20 static int created = 0,
24 Foo() :
x(-2),
y(-3.0f) { created++; }
25 Foo(
int X,
float Y) :
x(
X),
y(
Y) { created++; }
26 ~Foo() { destroyed++; }
31 struct alignas(8) OddAlignment {
41 Foo* foo = arena.make<Foo>(3, 4.0f);
46 arena.makeArrayDefault<
int>(10);
47 int* zeroed = arena.makeArray<
int>(10);
48 for (
int i = 0; i < 10; i++) {
51 Foo* fooArray = arena.makeArrayDefault<Foo>(10);
56 arena.make<OddAlignment>();
67 Foo* foo = arena.
make<Foo>(3, 4.0f);
74 for (
int i = 0; i < 10; i++) {
82 arena.
make<OddAlignment>();
91 std::unique_ptr<char[]> block{
new char[1024]};
94 Foo* foo = arena.make<Foo>(3, 4.0f);
99 arena.makeArrayDefault<
int>(10);
100 int* zeroed = arena.makeArray<
int>(10);
101 for (
int i = 0; i < 10; i++) {
104 Foo* fooArray = arena.makeArrayDefault<Foo>(10);
109 arena.make<OddAlignment>();
124 for (
int arenaSize : {1, 2, 3, 10, 100, 1000}) {
125 for (
int alloc1Size : {1, 10, 100, 1000}) {
126 for (
int alloc2Size : {1, 10, 100, 1000}) {
130 [[maybe_unused]]
char* alloc1 = arena.
makeArray<
char>(alloc1Size);
133 [[maybe_unused]]
char* alloc2 = arena.
makeArray<
char>(alloc2Size);
214 uint32_t lastSize = 1;
215 for (
int i = 0; i < 64; i++) {
216 uint32_t size = fibs.nextBlockSize();
224 uint32_t lastSize = 1;
225 for (
int i = 0; i < 64; i++) {
226 uint32_t size = fibs.nextBlockSize();
236 uint32_t lastSize = 1;
237 for (
int i = 0; i < 64; i++) {
238 uint32_t size = fibs.nextBlockSize();
241 REPORTER_ASSERT(r, lastSize <= std::numeric_limits<uint32_t>::max() / 2);