Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.7 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. // File: mem.hxx
  7. //
  8. // Contents: IMalloc interface implementations
  9. // Note that these functions do little more than
  10. // the normal delete and new. They are provided
  11. // so that existing code can be ported to the ref.
  12. // impl. easily.
  13. //
  14. //---------------------------------------------------------------
  15. #ifndef _MEM__HXX__
  16. #define _MEM__HXX__
  17. #include "ref.hxx"
  18. #include "storage.h"
  19. class CAllocator: public IMalloc
  20. {
  21. public:
  22. inline CAllocator();
  23. inline ~CAllocator();
  24. // IMalloc Methods
  25. STDMETHOD_(ULONG,AddRef) ( void );
  26. STDMETHOD_(ULONG,Release) ( void );
  27. STDMETHOD(QueryInterface) ( REFIID riid, void ** ppv );
  28. STDMETHOD_(void*,Alloc) ( ULONG cb );
  29. STDMETHOD_(void *,Realloc) ( void *pv, ULONG cb );
  30. STDMETHOD_(void,Free) ( void *pv );
  31. STDMETHOD_(ULONG,GetSize) ( void * pv );
  32. STDMETHOD_(void,HeapMinimize) ( void );
  33. STDMETHOD_(int,DidAlloc) ( void * pv );
  34. };
  35. //+--------------------------------------------------------------
  36. //
  37. // Member: CAllocator::CAllocator(), public
  38. //
  39. // Synopsis: Constructor
  40. //
  41. //---------------------------------------------------------------
  42. inline CAllocator::CAllocator()
  43. {
  44. // does nothing
  45. }
  46. //+--------------------------------------------------------------
  47. //
  48. // Member: CAllocator::~CAllocator(), public
  49. //
  50. // Synopsis: Destructor
  51. //
  52. //---------------------------------------------------------------
  53. inline CAllocator::~CAllocator()
  54. {
  55. // does nothing
  56. }
  57. #endif // ndef _MEM__HXX__