diff --git a/Source/CMake/HelperMethods.cmake b/Source/CMake/HelperMethods.cmake index 6e61614ee..84438df02 100644 --- a/Source/CMake/HelperMethods.cmake +++ b/Source/CMake/HelperMethods.cmake @@ -582,7 +582,7 @@ function(add_common_flags target) elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # Note: Optionally add -ffunction-sections, -fdata-sections, but with linker option --gc-sections # TODO: Use link-time optimization -flto. Might require non-default linker. - set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wno-unused-parameter -fPIC -fno-strict-aliasing -msse4.1) + set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wno-unused-parameter -fPIC -fno-strict-aliasing -msse4.1 -fvisibility=hidden -fvisibility-inlines-hidden) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS -fno-ms-compatibility) diff --git a/Source/Foundation/bsfUtility/Allocators/BsMemoryAllocator.h b/Source/Foundation/bsfUtility/Allocators/BsMemoryAllocator.h index 883769272..06060ad70 100644 --- a/Source/Foundation/bsfUtility/Allocators/BsMemoryAllocator.h +++ b/Source/Foundation/bsfUtility/Allocators/BsMemoryAllocator.h @@ -100,15 +100,15 @@ namespace bs * Thread safe class used for storing total number of memory allocations and deallocations, primarily for statistic * purposes. */ - class MemoryCounter + class BS_UTILITY_EXPORT MemoryCounter { public: - static BS_UTILITY_EXPORT uint64_t getNumAllocs() + static uint64_t getNumAllocs() { return Allocs; } - static BS_UTILITY_EXPORT uint64_t getNumFrees() + static uint64_t getNumFrees() { return Frees; } @@ -116,9 +116,8 @@ namespace bs private: friend class MemoryAllocatorBase; - // Threadlocal data can't be exported, so some magic to make it accessible from MemoryAllocator - static BS_UTILITY_EXPORT void incAllocCount() { ++Allocs; } - static BS_UTILITY_EXPORT void incFreeCount() { ++Frees; } + static void incAllocCount() { ++Allocs; } + static void incFreeCount() { ++Frees; } static BS_THREADLOCAL uint64_t Allocs; static BS_THREADLOCAL uint64_t Frees;