次の方法で共有

Facebook x.com LinkedIn 電子メール

_get_heap_handle

C ランタイム システムが使用するヒープのハンドルを返します。

intptr_t _get_heap_handle( void );

戻り値

C ランタイム システムが使用する Win32 ヒープを識別するハンドルを返します。

解説

この関数を使用すると、HeapSetInformation を呼び出して CRT ヒープで Low Fragmentation Heap (LFH) を有効にできます。

必要条件

ルーチン

必須ヘッダー

_get_heap_handle

<malloc.h>

互換性の詳細については、「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;
}

参照

参照

メモリ割り当て


  • Last updated on 2011年08月09日