MCPcopy Create free account
hub / github.com/apache/brpc / add

Method add

src/butil/thread_local.cpp:45–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 }
44
45 int add(Fn fn, void* arg) {
46 try {
47 if (_fns.capacity() < 16) {
48 _fns.reserve(16);
49 }
50 _fns.emplace_back(fn, arg);
51 } catch (...) {
52 errno = ENOMEM;
53 return -1;
54 }
55 return 0;
56 }
57
58 void remove(Fn fn, void* arg) {
59 std::vector<Pair>::iterator

Callers 1

thread_atexitFunction · 0.45

Calls 2

capacityMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected