MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / init

Method init

deps/memkind/src/test/performance/framework.cpp:87–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 }
86
87 void Worker::init(const vector<Operation *> &testOperations,
88 Operation *&freeOperation)
89 {
90 for(uint32_t i = 0 ; i < m_actionsCount ; i++) {
91 int bucketSize = rand() % Operation::MaxBucketSize;
92
93 for (Operation *operation : testOperations) { //each operation
94 if (operation->checkCondition(bucketSize)) {
95 size_t size = m_allocationSizes[m_allocationSizes.size() > 1 ? rand() %
96 m_allocationSizes.size() : 0];
97 m_actions[i] = new Action(
98 operation,
99 freeOperation,
100 m_kind,
101 size,
102 log2(rand() % size),
103 sizeof(void *) * (1 << ((rand() % Operation::MemalignMaxMultiplier))));
104 break;
105 }
106 }
107 }
108 }
109
110 void Worker::run()
111 {

Callers 4

initConfigValuesFunction · 0.80
prepareWorkersMethod · 0.80
runMethod · 0.80
heap_manager_initFunction · 0.80

Calls 2

checkConditionMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected