Skip to content

Commit 8d7950b

Browse files
Use std placement new on non MSVC compilers
1 parent e26c81f commit 8d7950b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/Common/Memory/Allocator.h

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#pragma once
@@ -448,6 +449,8 @@ void AssertValue(void * mem, T value, uint byteCount)
448449
#define NO_EXPORT(x) x
449450
#endif
450451

452+
#if defined(_MSC_VER) && !defined(__clang__)
453+
451454
// For the debugger extension, we don't need the placement news
452455
#ifndef __PLACEMENT_NEW_INLINE
453456
#define __PLACEMENT_NEW_INLINE
@@ -473,6 +476,14 @@ void * previousAllocation // Previously allocated memory
473476

474477
#endif
475478

479+
#else
480+
481+
// Use std inline placement new instead of custom
482+
// See PR #7009
483+
#include <new>
484+
485+
#endif
486+
476487
//----------------------------------------
477488
// throwing operator new overrides
478489
//----------------------------------------

0 commit comments

Comments
 (0)