diff options
Diffstat (limited to 'src/oldpool.h')
-rw-r--r-- | src/oldpool.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/oldpool.h b/src/oldpool.h index ab496d2c3..17b791ed7 100644 --- a/src/oldpool.h +++ b/src/oldpool.h @@ -376,4 +376,10 @@ public: template type *PoolItem<type, type##ID, &_##name##_pool>::AllocateSafeRaw(uint &first); \ template bool PoolItem<type, type##ID, &_##name##_pool>::CanAllocateItem(uint count); +#define FOR_ALL_ITEMS_FROM(type, iter, var, start) \ + for (size_t iter = start; var = NULL, iter < type::GetPoolSize(); iter++) \ + if ((var = type::Get(iter))->IsValid()) + +#define FOR_ALL_ITEMS(type, iter, var) FOR_ALL_ITEMS_FROM(type, iter, var, 0) + #endif /* OLDPOOL_H */ |