MemPool.h 865 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // "$Id: MemPool.h 16503 2010-11-26 02:23:15Z wang_haifeng $"
  3. //
  4. // Copyright (c)1992-2007, ZheJiang Dahua Technology Stock CO.LTD.
  5. // All Rights Reserved.
  6. //
  7. // Description:
  8. // Revisions: Year-Month-Day SVN-Author Modification
  9. //
  10. #ifndef __INFRA_MEM_POOL_H__
  11. #define __INFRA_MEM_POOL_H__
  12. #include "../Defs.h"
  13. namespace Dahua {
  14. namespace Memory {
  15. namespace Detail {
  16. struct MemPoolInternal;
  17. /// \class CMemPool 非线程安全的内存池类; 不提供给外部使用, 所以不写接口说明
  18. class MEMORY_API CMemPool
  19. {
  20. CMemPool(CMemPool const&); // copy protection
  21. CMemPool& operator=(CMemPool const&); // assign protection
  22. public:
  23. CMemPool(unsigned int sz, unsigned int inc);
  24. ~CMemPool();
  25. void* malloc();
  26. void free(void *b);
  27. private:
  28. MemPoolInternal *m_internal;
  29. };
  30. } // namespace Detail
  31. } // namespace Memory
  32. } // namespace Dahua
  33. #endif // __INFRA_MEM_POOL_H__