| 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 | { |
no test coverage detected