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 @@ -73,7 +73,7 @@ if(MSVC)
73
73
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" )
74
74
# Note: Optionally add -ffunction-sections, -fdata-sections, but with linker option --gc-sections
75
75
# TODO: Use link-time optimization -flto. Might require non-default linker.
76
- set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-ms-compatibility" )
76
+ 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" )
77
77
78
78
if (LINUX)
79
79
set (BS_COMPILER_FLAGS_COMMON "${BS_COMPILER_FLAGS_COMMON} -Wl,-rpath=$ORIGIN" )
@@ -96,7 +96,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "A
96
96
97
97
elseif ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" )
98
98
# TODO: Use link-time optimization -flto. Might require non-default linker.
99
- set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti" )
99
+ set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -fvisibility-inlines-hidden - fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti" )
100
100
101
101
if (LINUX)
102
102
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