| 12 | } |
| 13 | |
| 14 | static void test_mmap_write(int max, size_t off) |
| 15 | { |
| 16 | const char* filename = "local.map"; |
| 17 | acl::fstream fp; |
| 18 | if (!fp.open(filename, O_RDWR | O_CREAT /* | O_TRUNC */, 0600)) |
| 19 | { |
| 20 | printf("open %s error %s\r\n", filename, acl::last_serror()); |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | size_t max_len = 1024 * 1024 * 500, init_len = 4096; |
| 25 | acl::string buf(fp.file_handle(), max_len, init_len, off); |
| 26 | |
| 27 | ACL_METER_TIME(">> begin acl::string"); |
| 28 | |
| 29 | for (int i = 0; i < max; i++) |
| 30 | { |
| 31 | test_append(buf); |
| 32 | } |
| 33 | |
| 34 | ACL_METER_TIME(">> end acl::string"); |
| 35 | } |
| 36 | |
| 37 | static void test_mmap_read(size_t off) |
| 38 | { |
no test coverage detected
searching dependent graphs…