C ランタイム システムが使用するヒープのハンドルを返します。
intptr_t _get_heap_handle( void );
C ランタイム システムが使用する Win32 ヒープを識別するハンドルを返します。
この関数を使用すると、HeapSetInformation を呼び出して CRT ヒープで Low Fragmentation Heap (LFH) を有効にできます。
|
ルーチン
|
必須ヘッダー
|
互換性
|
| _get_heap_handle | <malloc.h> |
Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition、Windows NT 4.0、Windows 2000、Windows XP Home Edition、Windows XP Professional、Windows Server 2003 |
互換性の詳細については、「C ランタイム ライブラリ」の「互換性」を参照してください。
// crt_get_heap_handle.cpp
// compile with: /MT
#include <windows.h>
#include <malloc.h>
#include <stdio.h>
int main(void)
{
intptr_t hCrtHeap = _get_heap_handle();
ULONG ulEnableLFH = 2;
if (HeapSetInformation((PVOID)hCrtHeap,
HeapCompatibilityInformation,
&ulEnableLFH, sizeof(ulEnableLFH)))
puts("Enabling Low Fragmentation Heap succeeded");
else
puts("Enabling Low Fragmentation Heap failed");
return 0;
}
関連項目
メモリ割り当て