#include <catch2/catch.hpp>
#include <iostream>
#include <fstream>
#include <sysio/vm/backend.hpp>
Go to the source code of this file.
|
| TEST_CASE ("Allocate until failure", "[alloc_fail]") |
|
◆ CATCH_CONFIG_MAIN
#define CATCH_CONFIG_MAIN |
◆ TEST_CASE()
TEST_CASE |
( |
"Allocate until failure" | , |
|
|
"" | [alloc_fail] ) |
Definition at line 11 of file growable_allocator_test.cpp.
11 {
13 int* base = ga.alloc<int>(0);
14 int* p1, *p2;
15 size_t amt1, amt2;
16
17 auto equals = [&](auto* p1, auto* p2, size_t off) {
19 };
20
21 auto alloc = [&](
size_t amt) {
return (
int*)ga.alloc<
uint8_t>(amt); };
22 auto is_aligned = [](
auto*
p) {
return ((
uintptr_t)
p) % 16 == 0; };
23
24 p1 = alloc(15);
25
26
28
29
31
32 p2 = alloc(1);
35
36 p1 = alloc(1);
39}
_W64 unsigned int uintptr_t