Reactos
at master 40 lines 1.2 kB view raw
1// 2// debug_heap_hook.cpp 3// 4// Copyright (c) Microsoft Corporation. All rights reserved. 5// 6// Definition of the default debug heap allocation hook. This is in its own 7// object so that it may be replaced by a client hook at link time when the 8// static CRT is used. 9// 10#ifndef _DEBUG 11 #error This file is supported only in debug builds 12#endif 13 14#include <corecrt_internal.h> 15 16 17 18// A default heap allocation hook that permits all allocations 19extern "C" int __cdecl _CrtDefaultAllocHook( 20 int const allocation_type, 21 void* const data, 22 size_t const size, 23 int const block_use, 24 long const request, 25 unsigned char const* const file_name, 26 int const line_number 27 ) 28{ 29 UNREFERENCED_PARAMETER(allocation_type); 30 UNREFERENCED_PARAMETER(data); 31 UNREFERENCED_PARAMETER(size); 32 UNREFERENCED_PARAMETER(block_use); 33 UNREFERENCED_PARAMETER(request); 34 UNREFERENCED_PARAMETER(file_name); 35 UNREFERENCED_PARAMETER(line_number); 36 37 return 1; // Allow all heap operations 38} 39 40extern "C" { _CRT_ALLOC_HOOK _pfnAllocHook = _CrtDefaultAllocHook; }