1 // Some basic allocations and accesses.
10 int64_t* m
= malloc(1000);
11 m
[0] = 1; // write 8 bytes
12 m
[10] = m
[1]; // read and write 8 bytes
14 char* c
= calloc(1, 2000);
15 for (int i
= 0; i
< 1000; i
++) {
16 c
[i
+ 1000] = c
[i
]; // read and write 1000 bytes
19 char* r
= realloc(m
, 3000); // read and write 1000 bytes (memcpy)
20 for (int i
= 0; i
< 500; i
++) {
21 r
[i
+ 2000] = 99; // write 500 bytes
24 c
= realloc(c
, 1000); // read and write 1000 bytes (memcpy)
27 // totals: 3008 read, 3516 write
29 // Should be ignored because we're not in ad hoc mode.
30 DHAT_AD_HOC_EVENT(100);