| 24 | } |
| 25 | |
| 26 | void Iterator::RegisterCleanup(CleanupFunction func, void* arg1, void* arg2) { |
| 27 | assert(func != nullptr); |
| 28 | CleanupNode* node; |
| 29 | if (cleanup_head_.IsEmpty()) { |
| 30 | node = &cleanup_head_; |
| 31 | } else { |
| 32 | node = new CleanupNode(); |
| 33 | node->next = cleanup_head_.next; |
| 34 | cleanup_head_.next = node; |
| 35 | } |
| 36 | node->function = func; |
| 37 | node->arg1 = arg1; |
| 38 | node->arg2 = arg2; |
| 39 | } |
| 40 | |
| 41 | namespace { |
| 42 |
no test coverage detected