Files
rk35xx-android14/system/extras/cpu_loads/memcpy.cpp
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

33 lines
670 B
C++

#include <arpa/inet.h>
#include <cutils/sockets.h>
#include <fcntl.h>
#include <hardware/gralloc.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <algorithm>
#include <chrono>
#include <fstream>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define BUFFER_SIZE (1024 * 1024 * 1024)
int main(int, char**) {
void* src = malloc(BUFFER_SIZE);
for (size_t i = 0; i < BUFFER_SIZE; i++) {
((char*)src)[i] = (char)i;
}
void* dst = malloc(BUFFER_SIZE);
while (true) {
memcpy(dst, src, BUFFER_SIZE);
}
((char*)dst)[0] = 0;
return 0;
}