]>
Commit | Line | Data |
---|---|---|
f95fe6ed | 1 | /* |
5b74111a | 2 | * Copyright (C) 1996-2018 The Squid Software Foundation and contributors |
f95fe6ed | 3 | * |
bbc27441 AJ |
4 | * Squid software is distributed under GPLv2+ license and includes |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
f95fe6ed | 7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: none Memory Allocation */ |
10 | ||
582c2af2 | 11 | #include "squid.h" |
00177188 | 12 | |
a45f2153 | 13 | #if !defined(__clang__) && !defined(__SUNPRO_CC) |
00177188 FC |
14 | |
15 | #include <new> | |
39cca4e1 AR |
16 | |
17 | void *operator new(size_t size) | |
00177188 FC |
18 | { |
19 | return xmalloc(size); | |
20 | } | |
39cca4e1 | 21 | void operator delete(void *address) |
00177188 | 22 | { |
39cca4e1 | 23 | xfree(address); |
00177188 | 24 | } |
39cca4e1 | 25 | void *operator new[](size_t size) |
00177188 FC |
26 | { |
27 | return xmalloc(size); | |
28 | } | |
39cca4e1 | 29 | void operator delete[](void *address) |
00177188 | 30 | { |
39cca4e1 | 31 | xfree(address); |
00177188 FC |
32 | } |
33 | ||
39cca4e1 AR |
34 | void *operator new(size_t size, const std::nothrow_t &tag) |
35 | { | |
36 | return xmalloc(size); | |
37 | } | |
38 | void operator delete(void *address, const std::nothrow_t &tag) | |
39 | { | |
40 | xfree(address); | |
41 | } | |
42 | void *operator new[](size_t size, const std::nothrow_t &tag) | |
43 | { | |
44 | return xmalloc(size); | |
45 | } | |
46 | void operator delete[](void *address, const std::nothrow_t &tag) | |
47 | { | |
48 | xfree(address); | |
49 | } | |
f53969cc | 50 | |
39cca4e1 | 51 | #endif /* !defined(__clang__) */ |
915eb719 | 52 |