forked from Fluorohydride/ygopro-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mem.cpp
39 lines (35 loc) · 758 Bytes
/
mem.cpp
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
/*
* mem.cpp
*
* Created on: 2011-9-8
* Author: argon
*/
//#define USE_TCMALLOC
#ifdef USE_TCMALLOC
#define PERFTOOLS_DLL_DECL
#include <tcmalloc.h>
void* operator new(size_t size) {
return tc_malloc(size);
}
void* operator new[](size_t size) {
return tc_malloc(size);
}
void* operator new(size_t size, const std::nothrow_t& nt) {
return tc_malloc(size);
}
void* operator new[](size_t size, const std::nothrow_t& nt) {
return tc_malloc(size);
}
void operator delete(void* p) {
return tc_free(p);
}
void operator delete[](void* p) {
return tc_free(p);
}
void operator delete(void* p, const std::nothrow_t& nt) {
return tc_free(p);
}
void operator delete[](void* p, const std::nothrow_t& nt) {
return tc_free(p);
}
#endif //USE_TCMALLOC