1
1
// -------------------------------------------------------------------------------------------------------
2
2
// Copyright (C) Microsoft. All rights reserved.
3
+ // Copyright (c) ChakraCore Project Contributors. All rights reserved.
3
4
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4
5
// -------------------------------------------------------------------------------------------------------
5
6
#pragma once
@@ -448,14 +449,16 @@ void AssertValue(void * mem, T value, uint byteCount)
448
449
#define NO_EXPORT (x ) x
449
450
#endif
450
451
452
+ #if defined(_MSC_VER) && !defined(__clang__)
453
+
451
454
// For the debugger extension, we don't need the placement news
452
455
#ifndef __PLACEMENT_NEW_INLINE
453
456
#define __PLACEMENT_NEW_INLINE
454
457
455
458
_Ret_notnull_
456
459
NO_EXPORT (inline void *) __cdecl
457
460
operator new(
458
- DECLSPEC_GUARD_OVERFLOW size_t byteSize,
461
+ DECLSPEC_GUARD_OVERFLOW size_t byteSize,
459
462
_In_ void * previousAllocation) throw()
460
463
{
461
464
return previousAllocation;
@@ -466,13 +469,21 @@ NO_EXPORT(inline void) __cdecl
466
469
operator delete(
467
470
void * allocationToFree, // Allocation to free
468
471
void * previousAllocation // Previously allocated memory
469
- ) throw()
472
+ ) throw()
470
473
{
471
474
472
475
}
473
476
474
477
#endif
475
478
479
+ #else
480
+
481
+ // Use std inline placement new instead of custom
482
+ // See PR #7009
483
+ #include < new>
484
+
485
+ #endif
486
+
476
487
// ----------------------------------------
477
488
// throwing operator new overrides
478
489
// ----------------------------------------
0 commit comments