واجهة IHostMemoryManager
توفير طرق تسمح بوقت تشغيل اللغة العامة (CLR) إلى إجراء طلبات ذاكرة ظاهرية من خلال مضيف، بدلاً من استخدام دالات Win32 القياسية على ذاكرة ظاهرية.
interface IHostMemoryManager : IUnknown {
HRESULT CreateMAlloc (
[in] BOOL fThreadSafe,
[out] IHostMalloc **ppMalloc
);
HRESULT VirtualAlloc (
[in] void* pAddress,
[in] SIZE_T dwSize,
[in] DWORD flAllocationType,
[in] DWORD flProtect,
[in] EMemoryCriticalLevel dwCriticalLevel,
[out] void** ppMem
);
HRESULT VirtualFree (
[in] LPVOID lpAddress,
[in] SIZE_T dwSize,
[in] DWORD dwFreeType
);
HRESULT VirtualQuery (
[in] void* lpAddress,
[out] void* lpBuffer,
[in] SIZE_T dwLength,
[out] SIZE_T *pResult
);
HRESULT VirtualProtect (
[in] void* lpAddress,
[in] SIZE_T dwSize,
[in] DWORD flNewProtect,
[out] DWORD* pflOldProtect
);
HRESULT GetMemoryLoad (
[out] DWORD* pMemoryLoad,
[out] SIZE_T *pAvailableBytes
);
HRESULT RegisterMemoryNotificationCallback (
[in] ICLRMemoryNotificationCallback* pCallback
);
HRESULT NeedsVirtualAddressSpace(
[in] LPVOID startAddress,
[in] SIZE_T size
);
HRESULT AcquiredVirtualAddressSpace(
[in] LPVOID startAddress,
[in] SIZE_T size
);
HRESULT ReleasedVirtualAddressSpace(
[in] LPVOID startAddress
);
};
الأساليب
Method |
الوصف |
---|---|
قم بإعلام مضيف التي اللغة الشائعة وقت التشغيل (CLR) اكتسب الذاكرة المعينة من النظام التشغيل. |
|
Gets an واجهة مؤشر إلى an IHostMAlloc مثيل that هو used to طلب ذاكرة allocations من a كومة ذاكرة مؤقتة تاريخ الإنشاء بواسطة the مضيف. |
|
Gets the المقدار of physical ذاكرة that هو currently being used, كـ reported بواسطة the مضيف. |
|
Notifies the مضيف that the CLR هو going إلى attempt إلى استخدم the specified ذاكرة. |
|
أسلوب IHostMemoryManager::RegisterMemoryNotificationCallback |
مسجلات a مؤشر إلى a callback دالة that the مضيف invokes to notify the CLR of the الحالي ذاكرة تحميل تشغيل the الكمبيوتر. |
Notifies the مضيف that the CLR has finished using the specified ذاكرة. |
|
Serves كـ a logical برنامج تضمين for the corresponding Win32 دالة, which reserves أو commits a منطقة of الصفحات في the ظاهري العنوان مسافة of the calling عملية. |
|
Serves كـ a logical برنامج تضمين for the corresponding Win32 دالة, which releases, decommits, أو releases و decommits a منطقة of الصفحات within the ظاهري العنوان مسافة of the calling عملية. |
|
Serves كـ a logical برنامج تضمين for the corresponding Win32 دالة, which التغييرات the حماية تشغيل a منطقة of committed الصفحات في the ظاهري العنوان مسافة of the calling عملية. |
|
Serves كـ a logical برنامج تضمين for the corresponding Win32 دالة, which retrieves معلومات حول a range of الصفحات في the ظاهري العنوان مسافة of the calling عملية. |
ملاحظات
IHostMemoryManager also provides وظائف for the CLR إلى obtain a مؤشر through which إلى make ذاكرة requests تشغيل the كومة ذاكرة مؤقتة و إلى يحصل the المستوى of ذاكرة pressure في the عملية, كـ reported بواسطة the مضيف.
المتطلبات
الأنظمة الأساسية: See متطلبات النظام إطار عمل .NET.
**Header:**MSCorEE.idl
**المكتبة:**مُضمن كـ مورد في MSCorEE.dll
.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0