| 165 | } |
| 166 | |
| 167 | int PopBatch(int N, void** ret) { |
| 168 | int count = list_.size(); |
| 169 | if (count > N) { |
| 170 | count = N; |
| 171 | } |
| 172 | for (int i = 0; i < count; ++i) { |
| 173 | ret[i] = list_.back(); |
| 174 | list_.pop_back(); |
| 175 | } |
| 176 | |
| 177 | return count; |
| 178 | } |
| 179 | |
| 180 | private: |
| 181 | std::list<void*> list_; |
no test coverage detected