| 267 | }; |
| 268 | |
| 269 | ValueType* AllocPtr() { |
| 270 | ValueType* ptr = NULL; |
| 271 | if (!_ptr_list.empty()) { |
| 272 | ptr = _ptr_list.front(); |
| 273 | _ptr_list.pop(); |
| 274 | } else { |
| 275 | ptr = new ValueType; |
| 276 | _total++; |
| 277 | } |
| 278 | |
| 279 | return ptr; |
| 280 | }; |
| 281 | |
| 282 | void FreePtr(ValueType* ptr) { |
| 283 | if ((int)_ptr_list.size() >= _max_free) { |
no outgoing calls
no test coverage detected