⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 taskallocator.h

📁 vxworks源代码
💻 H
字号:
/* TaskAllocator.h */#ifndef __INCTaskAllocator_h#define __INCTaskAllocator_h#include "comLib.h"#include "private/comMisc.h"//////////////////////////////////////////////////////////////////////////////// VxTaskAllocator - this class *CANNOT* be implemented using the// CComObject classes because it is the object that allows those// objects to allocate memory, and this would be self-referential.//// This allocator just uses malloc() and friends, so it utilises the// system memory partition.//// resolve clashes in networking headers#ifdef Free#undef Free#endifclass VxTaskAllocator : public IMalloc    {  public:    VxTaskAllocator ();    virtual ~VxTaskAllocator ();    // IUnknown methods...    STDMETHOD_(ULONG, AddRef) ();    STDMETHOD_(ULONG, Release) ();    STDMETHOD(QueryInterface) (REFIID riid, void** ppv);        // IMalloc methods    void* STDMETHODCALLTYPE Alloc (ULONG cb);    void* STDMETHODCALLTYPE Realloc (void *pv, ULONG cb);    void  STDMETHODCALLTYPE Free (void *pv);    ULONG STDMETHODCALLTYPE GetSize (void *pv);    int   STDMETHODCALLTYPE DidAlloc (void *pv);    void  STDMETHODCALLTYPE HeapMinimize (); private:    DWORD	m_dwRefCount;    VxMutex	m_mutex;    };extern HRESULT comCoGetMalloc (DWORD dwMemContext, IMalloc** ppMalloc);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -