Compartir a través de


_get_heap_handle

Devuelve el identificador del montón usado por el sistema en tiempo de ejecución de C.

Importante

Esta API no se puede usar en aplicaciones que se ejecutan en Windows en tiempo de ejecución, salvo en compilaciones Debug.Para obtener más información, vea Funciones de CRT no admitidas con /ZW.

intptr_t _get_heap_handle( void );

Valor devuelto

Devuelve el identificador del montón de Win32 usado por el sistema en tiempo de ejecución de C.

Comentarios

Use esta función si desea llamar a HeapSetInformation y habilitar el montón de baja fragmentación en el montón de CRT.

Requisitos

Rutina

Encabezado necesario

_get_heap_handle

<malloc.h>

Para obtener más información sobre compatibilidad, vea Compatibilidad.

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