- 要读入的test_data.txt数据:
每行3个数字,分别记为u ,v, c
. - mmap读取数据
void parseInput(string &path)
{
long long u,v,c;
int fd = open(path.c_str(), O_RDONLY);
int buf_len = 40 * 1024 * 1024; // 定义buffer大小
char * buf = (char *) mmap(NULL, buf_len, PROT_READ, MAP_PR