@@ -351,7 +351,6 @@ class Allocator
351
351
void (*recoverMemoryFunc)();
352
352
};
353
353
354
-
355
354
template <typename T>
356
355
void AssertValue (void * mem, T value, uint byteCount)
357
356
{
@@ -365,12 +364,20 @@ void AssertValue(void * mem, T value, uint byteCount)
365
364
}
366
365
}
367
366
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
+
368
375
// For the debugger extension, we don't need the placement news
369
376
#ifndef __PLACEMENT_NEW_INLINE
370
377
#define __PLACEMENT_NEW_INLINE
371
378
372
- NO_EXPORT _Ret_notnull_
373
- inline void * __cdecl
379
+ _Ret_notnull_
380
+ NO_EXPORT ( inline void *) __cdecl
374
381
operator new(
375
382
DECLSPEC_GUARD_OVERFLOW size_t byteSize,
376
383
_In_ void * previousAllocation) throw()
@@ -379,7 +386,7 @@ _In_ void * previousAllocation) throw()
379
386
}
380
387
381
388
382
- NO_EXPORT inline void __cdecl
389
+ NO_EXPORT ( inline void ) __cdecl
383
390
operator delete(
384
391
void * allocationToFree, // Allocation to free
385
392
void * previousAllocation // Previously allocated memory
@@ -394,7 +401,8 @@ void * previousAllocation // Previously allocated memory
394
401
// throwing operator new overrides
395
402
// ----------------------------------------
396
403
template <typename TAllocator>
397
- NO_EXPORT _Ret_notnull_ void * __cdecl
404
+ _Ret_notnull_
405
+ NO_EXPORT (void *) __cdecl
398
406
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t ))
399
407
{
400
408
AssertCanHandleOutOfMemory ();
@@ -405,7 +413,8 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char *
405
413
}
406
414
407
415
template <typename TAllocator>
408
- NO_EXPORT _Ret_notnull_ inline void * __cdecl
416
+ _Ret_notnull_
417
+ NO_EXPORT (inline void *) __cdecl
409
418
operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t ))
410
419
{
411
420
AssertCanHandleOutOfMemory ();
@@ -416,7 +425,8 @@ operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char
416
425
}
417
426
418
427
template <typename TAllocator>
419
- NO_EXPORT _Ret_notnull_ inline void * __cdecl
428
+ _Ret_notnull_
429
+ NO_EXPORT (inline void *) __cdecl
420
430
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t ), DECLSPEC_GUARD_OVERFLOW size_t plusSize)
421
431
{
422
432
AssertCanHandleOutOfMemory ();
@@ -433,7 +443,8 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char *
433
443
// nothrow operator new overrides
434
444
// ----------------------------------------
435
445
template <typename TAllocator>
436
- NO_EXPORT _Ret_maybenull_ inline void * __cdecl
446
+ _Ret_maybenull_
447
+ NO_EXPORT (inline void *) __cdecl
437
448
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t ))
438
449
{
439
450
Assert (nothrow);
@@ -442,9 +453,9 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool n
442
453
return buffer;
443
454
}
444
455
445
-
446
456
template <typename TAllocator>
447
- NO_EXPORT _Ret_maybenull_ inline void * __cdecl
457
+ _Ret_maybenull_
458
+ NO_EXPORT (inline void *) __cdecl
448
459
operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t ))
449
460
{
450
461
Assert (nothrow);
@@ -453,9 +464,9 @@ operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool
453
464
return buffer;
454
465
}
455
466
456
-
457
467
template <typename TAllocator>
458
- NO_EXPORT _Ret_maybenull_ inline void * __cdecl
468
+ _Ret_maybenull_
469
+ NO_EXPORT (inline void *) __cdecl
459
470
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t ), DECLSPEC_GUARD_OVERFLOW size_t plusSize)
460
471
{
461
472
Assert (nothrow);
@@ -467,9 +478,9 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool n
467
478
return buffer;
468
479
}
469
480
470
-
471
481
template <typename TAllocator>
472
- NO_EXPORT _Ret_maybenull_ inline void * __cdecl
482
+ _Ret_maybenull_
483
+ NO_EXPORT (inline void *) __cdecl
473
484
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t ), DECLSPEC_GUARD_OVERFLOW size_t plusSize, bool prefix)
474
485
{
475
486
Assert (nothrow);
0 commit comments