home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / OWLINC.ZIP / SAFEPOOL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  798 b   |  37 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #if !defined(__SAFEPOOL_H)
  4. #define __SAFEPOOL_H
  5.  
  6. #if !defined(__OWLDEFS_H)
  7. #include <owldefs.h>
  8. #endif
  9.  
  10. #pragma option -Vo-
  11. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  12. #pragma option -po-
  13. #endif
  14.  
  15. const int DEFAULT_SAFETY_POOL_SIZE = 8192;
  16.  
  17. _CLASSDEF(SafetyPool)
  18.  
  19. class _EXPORT SafetyPool
  20. {
  21. public:
  22.     static  int            Allocate(size_t size
  23.                     = DEFAULT_SAFETY_POOL_SIZE);
  24.     static  int            IsExhausted()
  25.                   // returns true if safetyPool is exhausted
  26.                   { return safetyPool == NULL; };
  27.     static  int            Size;
  28.     static  Pvoid         safetyPool;
  29. };
  30.  
  31. #pragma option -Vo.
  32. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  33. #pragma option -po.
  34. #endif
  35.  
  36. #endif // __SAFEPOOL_H
  37.