関数リファレンス (アルファベット順)


ランタイム ライブラリ リファレンス
_get_heap_handle

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;
}
参照

関連項目

メモリ割り当て

タグ :


Page view tracker