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