ReactOS 0.4.16-dev-889-g9563c07
heapmin.cpp
Go to the documentation of this file.
1//
2// heapmin.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Implementation of _heapmin().
7//
8#include <corecrt_internal.h>
9#include <malloc.h>
10
11// Minimizes the heap, freeing as much memory as possible back to the OS.
12// Returns 0 on success, -1 on failure.
13extern "C" int __cdecl _heapmin()
14{
15 if (!HeapCompact(__acrt_heap, 0))
16 return -1;
17
18 return 0;
19}
#define __cdecl
Definition: accygwin.h:79
HANDLE __acrt_heap
Definition: heap_handle.cpp:15
SIZE_T WINAPI HeapCompact(HANDLE hHeap, DWORD dwFlags)
Definition: heapmem.c:145
int __cdecl _heapmin()
Definition: heapmin.cpp:13