| 23 | } |
| 24 | |
| 25 | int main() { |
| 26 | std::this_thread::sleep_for(std::chrono::seconds(1)); |
| 27 | |
| 28 | auto emit_marker = []() { |
| 29 | uint8_t* ptr = new uint8_t[0xC0D59EED]; |
| 30 | black_box(ptr); |
| 31 | delete[] ptr; |
| 32 | }; |
| 33 | |
| 34 | emit_marker(); |
| 35 | |
| 36 | // array: |
| 37 | uint32_t* allocated = new uint32_t[11111]; |
| 38 | black_box(allocated); |
| 39 | delete[] allocated; |
| 40 | |
| 41 | // single element: |
| 42 | uint64_t* var = new uint64_t; |
| 43 | black_box(var); |
| 44 | delete var; |
| 45 | |
| 46 | // vector: |
| 47 | std::vector<uint32_t> vec(22222, 0); |
| 48 | black_box(vec.data()); |
| 49 | |
| 50 | // aligned allocation (64-byte alignment for cache line): |
| 51 | uint8_t* aligned = static_cast<uint8_t*>(aligned_alloc(64, 64 * 512)); |
| 52 | black_box(aligned); |
| 53 | free(aligned); |
| 54 | |
| 55 | // posix_memalign: some allocators forward it to another exported symbol |
| 56 | // that is probed too, so this also guards against reporting it twice. |
| 57 | void* aligned_out = nullptr; |
| 58 | posix_memalign(&aligned_out, 128, 64 * 256); |
| 59 | black_box(aligned_out); |
| 60 | free(aligned_out); |
| 61 | |
| 62 | emit_marker(); |
| 63 | } |
nothing calls this directly
no test coverage detected