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

Function test2

lib_acl_cpp/samples/dbuf/alloc/main.cpp:88–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88static void test2(void) {
89 acl::dbuf_guard dbuf;
90 std::vector<myobj, acl::dbuf_allocator<myobj> > objs;
91 int i = 0;
92
93 //objs.reserve(10);
94
95 myobj o1(&dbuf, i++);
96 objs.push_back(o1);
97
98 myobj o2(&dbuf, i++);
99 objs.push_back(o2);
100
101 myobj o3(&dbuf, i++);
102 objs.push_back(o3);
103
104 myobj o4(&dbuf, i++);
105 objs.push_back(o4);
106
107 myobj o5(&dbuf, i++);
108 objs.push_back(o5);
109
110 printf("objs count is %ld\r\n", (long) objs.size());
111
112 for (std::vector<myobj, acl::dbuf_allocator<myobj> >::iterator
113 it = objs.begin(); it != objs.end(); ++it) {
114 (*it).run();
115 }
116}
117
118static void usage(const char* procname) {
119 printf("usage: %s -h [help] -n max -p pos -b nblock -c capacity"

Callers 1

mainFunction · 0.70

Calls 5

beginMethod · 0.80
push_backMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…