File tree 2 files changed +7
-8
lines changed
Foundation/bsfUtility/Allocators
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ if(MSVC)
74
74
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" )
75
75
# Note: Optionally add -ffunction-sections, -fdata-sections, but with linker option --gc-sections
76
76
# TODO: Use link-time optimization -flto. Might require non-default linker.
77
- set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-ms-compatibility" )
77
+ set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -fvisibility-inlines-hidden - fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-ms-compatibility" )
78
78
79
79
if (LINUX)
80
80
set (BS_COMPILER_FLAGS_COMMON "${BS_COMPILER_FLAGS_COMMON} -Wl,-rpath=$ORIGIN" )
@@ -94,7 +94,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "A
94
94
95
95
elseif ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" )
96
96
# TODO: Use link-time optimization -flto. Might require non-default linker.
97
- set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti" )
97
+ set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -fvisibility-inlines-hidden - fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti" )
98
98
99
99
if (LINUX)
100
100
set (BS_COMPILER_FLAGS_COMMON "${BS_COMPILER_FLAGS_COMMON} -Wl,-rpath=$ORIGIN" )
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