@@ -351,7 +351,6 @@ class Allocator
351351 void (*recoverMemoryFunc)();
352352};
353353
354-
355354template <typename T>
356355void AssertValue (void * mem, T value, uint byteCount)
357356{
@@ -365,12 +364,20 @@ void AssertValue(void * mem, T value, uint byteCount)
365364}
366365}
367366
367+ #ifndef _WIN32
368+ #define NO_EXPORT (x ) \
369+ __attribute__ ((visibility(" hidden" ))) \
370+ x
371+ #else
372+ #define NO_EXPORT (x ) x
373+ #endif
374+
368375// For the debugger extension, we don't need the placement news
369376#ifndef __PLACEMENT_NEW_INLINE
370377#define __PLACEMENT_NEW_INLINE
371378
372- NO_EXPORT _Ret_notnull_
373- inline void * __cdecl
379+ _Ret_notnull_
380+ NO_EXPORT ( inline void *) __cdecl
374381operator new(
375382DECLSPEC_GUARD_OVERFLOW size_t byteSize,
376383_In_ void * previousAllocation) throw()
@@ -379,7 +386,7 @@ _In_ void * previousAllocation) throw()
379386}
380387
381388
382- NO_EXPORT inline void __cdecl
389+ NO_EXPORT ( inline void ) __cdecl
383390operator delete(
384391void * allocationToFree, // Allocation to free
385392void * previousAllocation // Previously allocated memory
@@ -394,7 +401,8 @@ void * previousAllocation // Previously allocated memory
394401// throwing operator new overrides
395402// ----------------------------------------
396403template <typename TAllocator>
397- NO_EXPORT _Ret_notnull_ void * __cdecl
404+ _Ret_notnull_
405+ NO_EXPORT (void *) __cdecl
398406operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t ))
399407{
400408 AssertCanHandleOutOfMemory ();
@@ -405,7 +413,8 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char *
405413}
406414
407415template <typename TAllocator>
408- NO_EXPORT _Ret_notnull_ inline void * __cdecl
416+ _Ret_notnull_
417+ NO_EXPORT (inline void *) __cdecl
409418operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t ))
410419{
411420 AssertCanHandleOutOfMemory ();
@@ -416,7 +425,8 @@ operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char
416425}
417426
418427template <typename TAllocator>
419- NO_EXPORT _Ret_notnull_ inline void * __cdecl
428+ _Ret_notnull_
429+ NO_EXPORT (inline void *) __cdecl
420430operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t ), DECLSPEC_GUARD_OVERFLOW size_t plusSize)
421431{
422432 AssertCanHandleOutOfMemory ();
@@ -433,7 +443,8 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char *
433443// nothrow operator new overrides
434444// ----------------------------------------
435445template <typename TAllocator>
436- NO_EXPORT _Ret_maybenull_ inline void * __cdecl
446+ _Ret_maybenull_
447+ NO_EXPORT (inline void *) __cdecl
437448operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t ))
438449{
439450 Assert (nothrow);
@@ -442,9 +453,9 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool n
442453 return buffer;
443454}
444455
445-
446456template <typename TAllocator>
447- NO_EXPORT _Ret_maybenull_ inline void * __cdecl
457+ _Ret_maybenull_
458+ NO_EXPORT (inline void *) __cdecl
448459operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t ))
449460{
450461 Assert (nothrow);
@@ -453,9 +464,9 @@ operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool
453464 return buffer;
454465}
455466
456-
457467template <typename TAllocator>
458- NO_EXPORT _Ret_maybenull_ inline void * __cdecl
468+ _Ret_maybenull_
469+ NO_EXPORT (inline void *) __cdecl
459470operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t ), DECLSPEC_GUARD_OVERFLOW size_t plusSize)
460471{
461472 Assert (nothrow);
@@ -467,9 +478,9 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool n
467478 return buffer;
468479}
469480
470-
471481template <typename TAllocator>
472- NO_EXPORT _Ret_maybenull_ inline void * __cdecl
482+ _Ret_maybenull_
483+ NO_EXPORT (inline void *) __cdecl
473484operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t ), DECLSPEC_GUARD_OVERFLOW size_t plusSize, bool prefix)
474485{
475486 Assert (nothrow);
0 commit comments