src/oldpool.h
changeset 10316 6878402fa6e5
parent 10314 9cfcdd5b5ddb
child 10429 1b99254f9607
equal deleted inserted replaced
10315:b5a6fb206640 10316:6878402fa6e5
   292 	{
   292 	{
   293 		return Tpool->CleaningPool();
   293 		return Tpool->CleaningPool();
   294 	}
   294 	}
   295 
   295 
   296 public:
   296 public:
   297 	/**
   297 	static bool CanAllocateItem();
   298 	 * Check whether we can allocate an item in this pool. This to prevent the
       
   299 	 * need to actually construct the object and then destructing it again,
       
   300 	 * which could be *very* costly.
       
   301 	 * @return true if and only if at least ONE item can be allocated.
       
   302 	 */
       
   303 	static inline bool CanAllocateItem()
       
   304 	{
       
   305 		return AllocateRaw() != NULL;
       
   306 	}
       
   307 };
   298 };
   308 
   299 
   309 
   300 
   310 #define OLD_POOL_ENUM(name, type, block_size_bits, max_blocks) \
   301 #define OLD_POOL_ENUM(name, type, block_size_bits, max_blocks) \
   311 	enum { \
   302 	enum { \