Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sets default symbol visibility to hidden. Resolves #74 #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/CMake/HelperMethods.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 5 additions & 6 deletions Source/Foundation/bsfUtility/Allocators/BsMemoryAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,25 +100,24 @@ 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;
}

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;
Expand Down