File tree 2 files changed +6
-7
lines changed
Foundation/bsfUtility/Allocators
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -582,7 +582,7 @@ function(add_common_flags target)
582
582
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" OR "${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" )
583
583
# Note: Optionally add -ffunction-sections, -fdata-sections, but with linker option --gc-sections
584
584
# TODO: Use link-time optimization -flto. Might require non-default linker.
585
- set_property (TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wno-unused-parameter -fPIC -fno-strict-aliasing -msse4.1)
585
+ set_property (TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wno-unused-parameter -fPIC -fno-strict-aliasing -msse4.1 -fvisibility=hidden -fvisibility-inlines-hidden )
586
586
587
587
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" )
588
588
set_property (TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -fno-ms-compatibility)
Original file line number Diff line number Diff line change @@ -100,25 +100,24 @@ namespace bs
100
100
* Thread safe class used for storing total number of memory allocations and deallocations, primarily for statistic
101
101
* purposes.
102
102
*/
103
- class MemoryCounter
103
+ class BS_UTILITY_EXPORT MemoryCounter
104
104
{
105
105
public:
106
- static BS_UTILITY_EXPORT uint64_t getNumAllocs ()
106
+ static uint64_t getNumAllocs ()
107
107
{
108
108
return Allocs;
109
109
}
110
110
111
- static BS_UTILITY_EXPORT uint64_t getNumFrees ()
111
+ static uint64_t getNumFrees ()
112
112
{
113
113
return Frees;
114
114
}
115
115
116
116
private:
117
117
friend class MemoryAllocatorBase ;
118
118
119
- // Threadlocal data can't be exported, so some magic to make it accessible from MemoryAllocator
120
- static BS_UTILITY_EXPORT void incAllocCount () { ++Allocs; }
121
- static BS_UTILITY_EXPORT void incFreeCount () { ++Frees; }
119
+ static void incAllocCount () { ++Allocs; }
120
+ static void incFreeCount () { ++Frees; }
122
121
123
122
static BS_THREADLOCAL uint64_t Allocs;
124
123
static BS_THREADLOCAL uint64_t Frees;
You can’t perform that action at this time.
0 commit comments