MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / vector_incr

Function vector_incr

libCacheSim/traceAnalyzer/utils/include/utils.h:27–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template <typename T>
27void vector_incr(vector<T> &vec, size_t pos, T v) {
28 if (pos >= vec.size()) {
29 /* resize the vector so that we can increase,
30 * pos + 8 is to reduce the number of resize op */
31 vec.resize(pos + 2, 0);
32 }
33
34 vec[pos] += v;
35}
36
37// static inline void my_assert(bool b, const std::string &msg) {
38// if (!b) {

Callers 1

add_reqMethod · 0.85

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected