memory 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Filename: allocator
  2. // Created by: drose (12May00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. // This file, and all the other files in this directory, aren't
  19. // intended to be compiled--they're just parsed by CPPParser (and
  20. // interrogate) in lieu of the actual system headers, to generate the
  21. // interrogate database.
  22. #ifndef ALLOCATOR_H
  23. #define ALLOCATOR_H
  24. #include <stdtypedefs.h>
  25. #ifdef GCC_STYLE_ALLOCATOR
  26. class alloc {
  27. public:
  28. static void *allocate(size_t n);
  29. static void deallocate(void *p, size_t n);
  30. };
  31. #else // GCC_STYLE_ALLOCATOR
  32. template<class Type>
  33. class allocator {
  34. public:
  35. typedef Type *pointer;
  36. typedef const Type *const_pointer;
  37. typedef size_t size_type;
  38. INLINE pointer allocate(size_type n, allocator<void>::const_pointer hint = 0);
  39. INLINE void deallocate(pointer p, size_type n);
  40. };
  41. #endif // GCC_STYLE_ALLOCATOR
  42. #endif