STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcruntime_new.h
Go to the documentation of this file.
1 //
2 // vcruntime_new.h
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // Declarations and definitions of memory management functions in the VCRuntime.
7 //
8 #pragma once
9 
10 #include <vcruntime.h>
11 
12 #ifdef __cplusplus
13 extern "C++" {
14 
15 #pragma pack(push, _CRT_PACKING)
16 
17 #pragma warning(push)
18 #pragma warning(disable: 4985) // attributes not present on previous declaration
19 
20 #pragma push_macro("new")
21 #undef new
22 
23 #ifndef __NOTHROW_T_DEFINED
24 #define __NOTHROW_T_DEFINED
25  namespace std
26  {
27  struct nothrow_t { };
28 
29  #ifdef _CRT_ENABLE_SELECTANY_NOTHROW
30  extern __declspec(selectany) nothrow_t const nothrow;
31  #else
32  extern nothrow_t const nothrow;
33  #endif
34  }
35 #endif
36 
38 _VCRT_ALLOCATOR void* __CRTDECL operator new(
39  size_t _Size
40  );
41 
43 _VCRT_ALLOCATOR void* __CRTDECL operator new(
44  size_t _Size,
45  std::nothrow_t const&
46  ) throw();
47 
49 _VCRT_ALLOCATOR void* __CRTDECL operator new[](
50  size_t _Size
51  );
52 
54 _VCRT_ALLOCATOR void* __CRTDECL operator new[](
55  size_t _Size,
56  std::nothrow_t const&
57  ) throw();
58 
59 void __CRTDECL operator delete(
60  void* _Block
61  ) throw();
62 
63 void __CRTDECL operator delete(
64  void* _Block,
65  std::nothrow_t const&
66  ) throw();
67 
68 void __CRTDECL operator delete[](
69  void* _Block
70  ) throw();
71 
72 void __CRTDECL operator delete[](
73  void* _Block,
74  std::nothrow_t const&
75  ) throw();
76 
77 void __CRTDECL operator delete(
78  void* _Block,
79  size_t _Size
80  ) throw();
81 
82 void __CRTDECL operator delete[](
83  void* _Block,
84  size_t _Size
85  ) throw();
86 
87 #ifndef __PLACEMENT_NEW_INLINE
88  #define __PLACEMENT_NEW_INLINE
90  inline void* __CRTDECL operator new(size_t _Size, _Writable_bytes_(_Size) void* _Where) throw()
91  {
92  (void)_Size;
93  return _Where;
94  }
95 
96  inline void __CRTDECL operator delete(void*, void*) throw()
97  {
98  return;
99  }
100 #endif
101 
102 #ifndef __PLACEMENT_VEC_NEW_INLINE
103  #define __PLACEMENT_VEC_NEW_INLINE
105  inline void* __CRTDECL operator new[](size_t _Size, _Writable_bytes_(_Size) void* _Where) throw()
106  {
107  (void)_Size;
108  return _Where;
109  }
110 
111  inline void __CRTDECL operator delete[](void*, void*) throw()
112  {
113  }
114 #endif
115 
116 #pragma pop_macro("new")
117 
118 #pragma warning(pop)
119 #pragma pack(pop)
120 
121 } // extern "C++"
122 #endif // __cplusplus
return
Definition: corecrt_memcpy_s.h:60
#define _Ret_maybenull_
Definition: sal.h:526
STL namespace.
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
#define __CRTDECL
Definition: vcruntime.h:156
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
__interface __declspec(uuid("00000035-0000-0000-C000-000000000046")) __abi_IActivationFactory
Definition: vccorlib.h:286
#define _Ret_notnull_
Definition: sal.h:525
#define _VCRT_ALLOCATOR
Definition: vcruntime.h:163
#define _Post_writable_byte_size_(size)
Definition: sal.h:649
#define _Writable_bytes_(size)
Definition: sal.h:634
#define _Success_(expr)
Definition: sal.h:256
#define NULL
Definition: corecrt.h:158