| 103 | } |
| 104 | |
| 105 | void clear(uint32_t offset) { |
| 106 | for (uint32_t i = 0; i < KEY_2NDLEVEL_SIZE; ++i) { |
| 107 | void* p = _data[i].ptr; |
| 108 | if (p) { |
| 109 | // Set the position to NULL before calling dtor which may set |
| 110 | // the position again. |
| 111 | _data[i].ptr = NULL; |
| 112 | |
| 113 | KeyInfo info = bthread::s_key_info[offset + i]; |
| 114 | if (info.dtor && _data[i].version == info.version) { |
| 115 | info.dtor(p, info.dtor_args); |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | bool cleared() const { |
| 122 | // We need to iterate again to check if every slot is empty. An |
no outgoing calls
no test coverage detected