1 //---------------------------------------------------------------
2 //
3 //  For conditions of distribution and use, see copyright notice
4 //  in Flashpix.h
5 //
6 //  Copyright (c) 1999 Digital Imaging Group, Inc.
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 
16 #ifndef _MEM__HXX__
17 #define _MEM__HXX__
18 
19 #include "ref.hxx"
20 #include "storage.h"
21 
22 class CAllocator: public IMalloc
23 {
24 public:
25     inline CAllocator();
26     virtual inline ~CAllocator();
27 
28     // IMalloc Methods
29     STDMETHOD_(ULONG,AddRef)    ( void );
30     STDMETHOD_(ULONG,Release)   ( void );
31     STDMETHOD(QueryInterface)   ( REFIID riid, void ** ppv );
32 
33     STDMETHOD_(void*,Alloc)     ( ULONG cb );
34     STDMETHOD_(void *,Realloc)  ( void *pv, ULONG cb );
35     STDMETHOD_(void,Free)       ( void *pv );
36     STDMETHOD_(ULONG,GetSize)   ( void * pv );
37     STDMETHOD_(void,HeapMinimize) ( void );
38     STDMETHOD_(int,DidAlloc)    ( void * pv );
39 };
40 
41 //+--------------------------------------------------------------
42 //
43 //  Member:   CAllocator::CAllocator(), public
44 //
45 //  Synopsis:   Constructor
46 //
47 //---------------------------------------------------------------
48 
CAllocator()49 inline CAllocator::CAllocator()
50 {
51     // does nothing
52 }
53 
54 //+--------------------------------------------------------------
55 //
56 //  Member:   CAllocator::~CAllocator(), public
57 //
58 //  Synopsis:   Destructor
59 //
60 //---------------------------------------------------------------
61 
~CAllocator()62 inline CAllocator::~CAllocator()
63 {
64     // does nothing
65 }
66 
67 #endif  // ndef _MEM__HXX__
68 
69 
70