Share via


_get_heap_handle

Devuelve el identificador de la pila utilizada por el sistema en tiempo de ejecución de C.

Nota importanteImportante

Esta API no se puede utilizar en las aplicaciones que se ejecutan en tiempo de ejecución de Windows a menos que en depuración compile.Para obtener más información, vea Funciones CRT no compatibles con /ZW.

intptr_t _get_heap_handle( void );

Valor devuelto

Devuelve el identificador de la pila de Win32 utilizada por el sistema en tiempo de ejecución de C.

Comentarios

Utilice esta función si desea llamar HeapSetInformation y habilitar la pila Low Fragmentation en el montón de CRT.

Requisitos

Rutina

Encabezado necesario

_get_heap_handle

<malloc.h>

Para obtener más información de compatibilidad, vea Compatibilidad en la Introducción.

Ejemplo

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

Vea también

Referencia

Asignación de memoria