Tim Murray | eee2fd8 | 2022-11-04 14:46:25 -0700 | [diff] [blame] | 1 | #include <arpa/inet.h> |
| 2 | #include <cutils/sockets.h> |
| 3 | #include <fcntl.h> |
| 4 | #include <hardware/gralloc.h> |
| 5 | #include <sys/stat.h> |
| 6 | #include <sys/wait.h> |
| 7 | #include <unistd.h> |
| 8 | #include <algorithm> |
| 9 | #include <chrono> |
| 10 | #include <fstream> |
| 11 | #include <iostream> |
| 12 | #include <numeric> |
| 13 | #include <string> |
| 14 | #include <tuple> |
| 15 | #include <vector> |
| 16 | |
| 17 | using namespace std; |
| 18 | |
| 19 | #define BUFFER_SIZE (2 * 1024 * 1024) |
| 20 | |
| 21 | int main(int, char**) { |
| 22 | void* src = malloc(BUFFER_SIZE); |
| 23 | for (size_t i = 0; i < BUFFER_SIZE; i++) { |
| 24 | ((char*)src)[i] = (char)i; |
| 25 | } |
| 26 | void* dst = malloc(BUFFER_SIZE); |
| 27 | while (true) { |
| 28 | memcpy(dst, src, BUFFER_SIZE); |
| 29 | } |
| 30 | ((char*)dst)[0] = 0; |
| 31 | return 0; |
| 32 | } |