_get_heap_handle

C 런타임 시스템에서 사용되는 힙의 핸들을 반환합니다.

구문

intptr_t _get_heap_handle( void );

반환 값

C 런타임 시스템에서 사용되는 Win32 힙에 대한 핸들을 반환합니다.

설명

CRT 힙에서 하위 조각화 힙을 호출 HeapSetInformation 하고 사용하도록 설정하려면 이 함수를 사용합니다.

기본적으로 이 함수의 전역 상태는 애플리케이션으로 범위가 지정됩니다. 이 동작을 변경하려면 CRT의 전역 상태를 참조하세요.

요구 사항

루틴에서 반환된 값 필수 헤더
_get_heap_handle <malloc.h>

호환성에 대한 자세한 내용은 호환성을 참조하세요.

예제

// 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;
}

참고 항목

메모리 할당