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 @@ -77,7 +77,7 @@ if(MSVC)
77
77
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" )
78
78
# Note: Optionally add -ffunction-sections, -fdata-sections, but with linker option --gc-sections
79
79
# TODO: Use link-time optimization -flto. Might require non-default linker.
80
- set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-ms-compatibility" )
80
+ 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" )
81
81
82
82
if (APPLE )
83
83
set (BS_COMPILER_FLAGS_COMMON "${BS_COMPILER_FLAGS_COMMON} -fobjc-arc -std=c++1z" )
@@ -95,7 +95,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "A
95
95
96
96
elseif ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" )
97
97
# TODO: Use link-time optimization -flto. Might require non-default linker.
98
- set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti" )
98
+ set (BS_COMPILER_FLAGS_COMMON "-Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -fvisibility-inlines-hidden - fPIC -fno-exceptions -fno-strict-aliasing -fno-rtti" )
99
99
100
100
set (CMAKE_CXX_FLAGS_DEBUG "${BS_COMPILER_FLAGS_COMMON} -ggdb -O0 -DDEBUG" )
101
101
set (CMAKE_CXX_FLAGS_OPTIMIZEDDEBUG "${BS_COMPILER_FLAGS_COMMON} -ggdb -O2 -DDEBUG -Wno-unused-variable" )
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