MCPcopy Create free account
hub / github.com/acl-dev/acl / test_mmap_write

Function test_mmap_write

lib_acl_cpp/samples/string/string5/main.cpp:14–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14static 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
37static void test_mmap_read(size_t off)
38{

Callers 1

mainFunction · 0.85

Calls 4

file_handleMethod · 0.80
test_appendFunction · 0.70
last_serrorFunction · 0.50
openMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…