다음을 통해 공유


_get_heap_handle

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

중요

이 API는 Windows 런타임에서 실행되는 응용 프로그램에서 사용할 수 없습니다.자세한 내용은 /ZW에서 지원하지 않는 CRT 함수를 참조하십시오.

intptr_t _get_heap_handle( void );

반환 값

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

설명

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

참고 항목

참조

메모리 할당